Validate your GitLab CI with GitLab's API endpoint.
Project description
pre-commit-gitlabci-lint
This is a pre-commit hook that uses GitLab's /api/v4/ci/lint
lint endpoint to validate the contents of .gitlab-ci.yml
files. This is similar in fashion to how CircleCI pre-commit hooks validate that product's required configs, which is by uploading your config to an endpoint.
By default, this tool sends your configuration to https://gitlab.com, though this can be overridden (see below).
This tool has been extended and adapted from kadrach's implementation (cf. the license).
Usage
GitLab Lint API now requires authorization.
- Create Access Token with
api
scope. - Set access token value as
GITLAB_TOKEN
environment variable.
Warning Please note the token should not be shared and if leaked can cause significant harm.
An example .pre-commit-config.yaml
:
---
repos:
- repo: https://github.com/bjd2385/pre-commit-gitlabci-lint
rev: <latest release>
hooks:
- id: gitlabci-lint
# args: ["https://custom.gitlab.host.com"]
Development
Install dependencies by running ./scripts/dependencies.sh
.
Releases
Update src/gitlabci_lint/validate.py/__version__
, setup.py/version
-string, and tag this repo's master branch with the same version string (prefixed by 'v
.)
TODOs:
- Allow passing multiple config files for validation in template repositories.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pre-commit-gitlabci-lint-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f44b1f5ceb7b180b1055fbb2a75fbb0202f621213b723bddc60e4b6f14774fa |
|
MD5 | 7e8426a87c316059769b3f7faa7856bc |
|
BLAKE2b-256 | 1cb7b645f48fc337b1df02e5d2429661ae4805c69ed98e10d332f33b7184e4a1 |
Hashes for pre_commit_gitlabci_lint-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adb0e25918fd0562ff1f5ef2f27c6879d4af2fbb3a07b91aa5aafa7d3e2c81b1 |
|
MD5 | 4962ef19137e8876d9135d130328d6e5 |
|
BLAKE2b-256 | 5a3990905b545eea0769b5edf21e79ce1041e850357d8068d69d6414e33c77f8 |