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