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/kadrach/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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6c2391959148d51ae283203b6f6b59a3588a2f27cce6168e5b3477f6920ad6 |
|
MD5 | 28cdff70f87c8738d896a3ed247eb01b |
|
BLAKE2b-256 | 4da870f97cec289ebaebe5e69e545b4eaeb8f7bb5662149b017048ece51fd652 |
Hashes for pre_commit_gitlabci_lint-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a94ed6dbf61a2cf98e7846711a0a1b6c34fe38212a0c700c115f5ee548c65552 |
|
MD5 | 525473fc2f4278a2320209a0735504a7 |
|
BLAKE2b-256 | 1d07baf328def4ee42c92ed46f1640f90081bfae60c90a4b3a4053494e7fc379 |