Skip to content

Validate the syntax of .gitlab-ci.yml files

License

Notifications You must be signed in to change notification settings

simp/github-action-gitlab-ci-syntax-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-action-gitlab-ci-syntax-check

Validate the syntax of .gitlab-ci.yml files

Verify Action tag badge license badge

Description

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.

Usage

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 }}

Reference

Action Inputs

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)

Action Outputs

Output Description
valid Returns `"true"` if the `.gitlab-ci.yml` is valid

Contributing

This is an open source project open to anyone. This project welcomes contributions and suggestions!

Feedback & Questions

If you discover an issue, please report it on our Jira at https://simp-project.atlassian.net/

License

Apache 2.0, See LICENSE for more information.