2.0.0 • Published 1 year ago

@techmynder/gitlab-ci-file-lint v2.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 year ago

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:

NameDescriptionRequired
GITLAB_LINT_TOKENThe GitLab access token (api scope)Yes
GITLAB_LINT_PROJECT_IDThe GitLab project ID to validate againstYes
GITLAB_LINT_FILEThe name of the file to validateNo (default: .gitlab-ci.yml)
GITLAB_LINT_BASE_URLThe base URL for the API requestNo (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.
1.0.2

1 year ago

2.0.0

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago