/workflow-lint

Lint GitHub Actions workflow files

Primary LanguageTypeScript

Workflow Lint 🧹

Lint GitHub Actions workflow files using cschleiden/github-actions-parser.

Usage

Create a workflow (eg: .github/workflows/seat-count.yml). See Creating a Workflow file.

Example (All)

Lint all files in .github/workflows

name: Usage
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
permissions: write-all

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: austenstone/workflow-lint@main

Example (Changed)

Lint all changed .yml files

name: Usage
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
permissions: write-all

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - id: changed-files
        uses: tj-actions/changed-files@v39
        with:
          files: "**/*.{yml,yaml}"
      - uses: austenstone/workflow-lint@main
        with:
          files: ${{ steps.changed-files.outputs.all_changed_files }}

➡️ Inputs

Various inputs are defined in action.yml:

Name Description Default
files Files to lint .github/workflows

⬅️ Outputs

Name Description
results The JSON results.

Further help

To get more help on the Actions see documentation.