actions-linter icon indicating copy to clipboard operation
actions-linter copied to clipboard

Simple linter for GitHub Actions workflow YAML files.

Recommendation

At this point I would recommend just using actionlint. Use it as a binary, or via the gh CLI - https://github.com/cschleiden/gh-actionlint. It supports more features and better linting!


Basic GitHub Actions workflow linter

Usage

To lint all workflow files

name: Lint workflows
on:
  pull_request:
    branches:
      - main
      - 'releases/*'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: cschleiden/actions-linter@v1
        with:
          workflows: '[".github/workflows/*.yaml"]'

Example

Future

The underlying parser does support using GitHub's API to dynamically fetch valid runner labels, action parameters etc. in general, but needs more granular control over the API calls made since the GITHUB_TOKEN doesn't have all of the required permissions. This functionality might be available in a future version, it's currently disabled 🤞.