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
.
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29cdb639eba5aff54b3a03820f0632aea3029c129fc5dbdf783b1dfe4960eb69 |
|
MD5 | ae0897070d61258faed37f195c495dc4 |
|
BLAKE2b-256 | 6e270167a351810ebb61a28e9714bc7bb99c61b981ee943bc8364f8699920e47 |
Hashes for pre_commit_gitlabci_lint-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3445844dc499b047da5a410b8bf18327c451f403714870e55c1ac9ef2b088d78 |
|
MD5 | e715b469e09899934526416f5deba2f6 |
|
BLAKE2b-256 | 5264951ff425905e300424be5f9d4fd4319bec15f089dc834e05c8c63c857cab |