Skip to content

Commit

Permalink
GH Actions: add actionlint job
Browse files Browse the repository at this point in the history
While GH Actions will fail runs of scripts which contain syntax errors, it isn't always that straight forward to see what's wrong.

The `actionlint` package helps with that by providing more informative error messages. Actionlint also checks for a number of best practice to help keep the GH Actions scripts secure and working.

Ref: https://github.com/rhysd/actionlint
  • Loading branch information
jrfnl committed Jan 21, 2025
1 parent 7fd3c0d commit 28b9365
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ concurrency:
cancel-in-progress: true

jobs:
actionlint: #----------------------------------------------------------------------
name: 'Check GHA workflows'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Add problem matcher
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
curl -o actionlint-matcher.json https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
echo "::add-matcher::actionlint-matcher.json"
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
with:
args: -color

phpcs: #----------------------------------------------------------------------
name: 'PHPCS'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 28b9365

Please sign in to comment.