feat(build): GitLab CI component, GitHub Actions action, and pre-commit hook
templates/check.yml — GitLab CI/CD Catalog component; downloads the glint Linux binary and runs glint check; inputs: stage, pipeline_file, version, allow_failure, extra_args. action.yml — GitHub Actions composite action; downloads glint into $RUNNER_TEMP and runs glint check; inputs: version, file, args. Mirror to github.com/k3nny/glint to use as `uses: k3nny/glint@vX.Y.Z`. .pre-commit-hooks.yaml — language: golang hook; pre-commit builds glint from source on first run and re-runs on staged .gitlab-ci.yml changes. Reference as repo: https://git.k3nny.fr/k3nny/glint. README updated with an Integrations section covering all three. Git remote corrected to https://git.k3nny.fr/k3nny/glint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
# GitHub Actions composite action — glint pipeline validator
|
||||
#
|
||||
# To use this action, mirror this repository to GitHub as k3nny/glint, then:
|
||||
#
|
||||
# - uses: k3nny/glint@v0.2.28
|
||||
# with:
|
||||
# file: .gitlab-ci.yml # optional
|
||||
#
|
||||
# Alternatively, copy this file into your own repository and reference it
|
||||
# as a local action:
|
||||
#
|
||||
# - uses: ./.github/actions/glint
|
||||
|
||||
name: 'glint'
|
||||
description: 'Validate a GitLab CI pipeline file with glint'
|
||||
author: 'k3nny'
|
||||
|
||||
branding:
|
||||
icon: 'check-circle'
|
||||
color: 'orange'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: >-
|
||||
glint release tag to install (e.g. 'v0.2.28'). Defaults to 'latest'
|
||||
which resolves to the newest published release.
|
||||
required: false
|
||||
default: 'latest'
|
||||
file:
|
||||
description: 'Path to the pipeline file to validate.'
|
||||
required: false
|
||||
default: '.gitlab-ci.yml'
|
||||
args:
|
||||
description: 'Additional arguments passed to glint check (e.g. --format sarif).'
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Install glint
|
||||
shell: bash
|
||||
env:
|
||||
GLINT_VERSION: ${{ inputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ "$GLINT_VERSION" = "latest" ]; then
|
||||
GLINT_VERSION=$(curl -sf \
|
||||
"https://git.k3nny.fr/api/v1/repos/k3nny/glint/releases?limit=1" \
|
||||
| grep '"tag_name"' | head -1 | cut -d'"' -f4)
|
||||
fi
|
||||
DEST="$RUNNER_TEMP/glint-bin"
|
||||
mkdir -p "$DEST"
|
||||
URL="https://git.k3nny.fr/k3nny/glint/releases/download/${GLINT_VERSION}/glint-${GLINT_VERSION}-linux-amd64"
|
||||
curl -sfL "$URL" -o "$DEST/glint"
|
||||
chmod +x "$DEST/glint"
|
||||
echo "$DEST" >> "$GITHUB_PATH"
|
||||
"$DEST/glint" --version
|
||||
|
||||
- name: Run glint check
|
||||
shell: bash
|
||||
run: glint check ${{ inputs.args }} "${{ inputs.file }}"
|
||||
Reference in New Issue
Block a user