Skip to content
play

GitHub Action

Github Actions Lint

v0.1.14 Latest version

Github Actions Lint

play

Github Actions Lint

Lint your github actions workflow files for versioned 3rd party actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Github Actions Lint

uses: digitalservicebund/[email protected]

Learn more about this action in digitalservicebund/github-actions-linter

Choose a version

Github Actions Linter

CI version

Linting for GitHub Actions workflows:

  • Detects referencing 3rd-party actions by mutable tags/references. The only actions allowed to be referenced in this way are actions created by GitHub itself.
# ❌ Bad
- name: Send status to Slack
  uses: lazy-actions/[email protected]

- name: Send status to Slack
  uses: lazy-actions/slatify@main

# ✅ Good
- name: Send status to Slack
  uses: lazy-actions/slatify@c4847b8c84e3e8076fd3c42cc00517a10426ed65 # == v3.0.0

Usage

Lint workflow files in .github/workflows:

Also available as a Github Action

name: CI

on:
  push:
    branches: [main]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: validate github workflow files to have pinned versions
        uses: digitalservicebund/github-actions-linter@LATEST_HASH

Releasing

👉 release-it

At first login to npmjs and then run the interactive wizard:

npm login
npm run release