Validate the syntax of .gitlab-ci.yml
files
A Github action to validate a .gitlab-ci.yml
file against a GitLab
service's CI Linter API.
Note that as of 04/2023, this API requires both a specific gitlab projects' CI Lint API endpoint and a personal access token that can use that project's endpoint.
on: [push]
jobs:
test_glci_syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: simp/github-action-gitlab-ci-syntax-check@v1
with:
gitlab_api_url: '${{ vars.GITLAB_API_URL }}/projects/simp%2Fsimp-core'
gitlab_api_private_token: ${{ secrets.GITLAB_API_PRIVATE_TOKEN }}
Input | Required | Description |
---|---|---|
gitlab_api_url |
Yes | GitLab project CI linter API endpoint (example: `https://gitlab.com/api/v4/projects/simp%2Fsimp-core`) |
gitlab_api_private_token |
Yes | GitLab API private token (necessary to access project CI linter) |
Output | Description |
---|---|
valid |
Returns `"true"` if the `.gitlab-ci.yml` is valid |
This is an open source project open to anyone. This project welcomes contributions and suggestions!
If you discover an issue, please report it on our Jira at https://simp-project.atlassian.net/
Apache 2.0, See LICENSE for more information.