@techmynder/gitlab-ci-file-lint
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

GitLab CI File Lint

A small library to help validate GitLab pipeline files using the official API.

Configuration

Create a .env file (or .env.local which will have precedence) with the following values:

Name Description Required
GITLAB_LINT_TOKEN The GitLab access token (api scope) Yes
GITLAB_LINT_PROJECT_ID The GitLab project ID to validate against Yes
GITLAB_LINT_FILE The name of the file to validate No (default: .gitlab-ci.yml)
GITLAB_LINT_BASE_URL The base URL for the API request No (default: https://gitlab.com)

Example

Using the minimal configuration in .env

GITLAB_LINT_TOKEN=secret
GITLAB_LINT_PROJECT_ID=1337

will validate the root .gitlab-ci.yml file.

Results

The results of the linter will be printed to the console with a matching exit code:

  • If the file has no issues, the script will exit with an exit code of 0.
  • If the file has no issues but warnings, the script will exit with an exit code of 0.
  • If the file has one or more issues, the script will exit with an exit code of 1.

Package Sidebar

Install

npm i @techmynder/gitlab-ci-file-lint

Weekly Downloads

228

Version

2.0.0

License

MIT

Unpacked Size

31.4 kB

Total Files

14

Last publish

Collaborators

  • botmynder
  • vntw
  • gruberro