ci / vet, staticcheck, test, build (push) Canceled after 0s
Mirror the repository to github.com/k3nnyfr/glint and build releases there as well as on Gitea. - .github/workflows/ci.yml: vet, staticcheck, test, build - .github/workflows/release.yml: build the six platform binaries and publish a GitHub release on each v* tag - action.yml: download from GitHub releases and pick the binary matching the runner OS/arch instead of always linux-amd64 - README/INSTALL/CHANGELOG: document the mirror, Homebrew tap renamed to k3nnyfr/homebrew-glint Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
# GitHub Actions composite action — glint pipeline validator
|
|
#
|
|
# Usage (from the GitHub mirror at k3nnyfr/glint):
|
|
#
|
|
# - uses: k3nnyfr/glint@vX.Y.Z
|
|
# 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.6.0'). 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 }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
REPO="k3nnyfr/glint"
|
|
if [ "$GLINT_VERSION" = "latest" ]; then
|
|
GLINT_VERSION=$(curl -sf \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
"https://api.github.com/repos/${REPO}/releases/latest" \
|
|
| grep '"tag_name"' | head -1 | cut -d'"' -f4)
|
|
fi
|
|
case "$RUNNER_OS" in
|
|
Linux) OS=linux ;;
|
|
macOS) OS=darwin ;;
|
|
Windows) OS=windows ;;
|
|
*) echo "unsupported runner OS: $RUNNER_OS" >&2; exit 1 ;;
|
|
esac
|
|
case "$RUNNER_ARCH" in
|
|
X64) ARCH=amd64 ;;
|
|
ARM64) ARCH=arm64 ;;
|
|
*) echo "unsupported runner arch: $RUNNER_ARCH" >&2; exit 1 ;;
|
|
esac
|
|
EXT=""
|
|
[ "$OS" = "windows" ] && EXT=".exe"
|
|
DEST="$RUNNER_TEMP/glint-bin"
|
|
mkdir -p "$DEST"
|
|
URL="https://github.com/${REPO}/releases/download/${GLINT_VERSION}/glint-${GLINT_VERSION}-${OS}-${ARCH}${EXT}"
|
|
curl -sfL "$URL" -o "$DEST/glint${EXT}"
|
|
chmod +x "$DEST/glint${EXT}"
|
|
echo "$DEST" >> "$GITHUB_PATH"
|
|
"$DEST/glint${EXT}" --version
|
|
|
|
- name: Run glint check
|
|
shell: bash
|
|
run: glint check ${{ inputs.args }} "${{ inputs.file }}"
|