Skip to content

Commit

Permalink
Merge pull request #2 from Yoast/JRF/add-reusable-actionlint-workflow
Browse files Browse the repository at this point in the history
QA: add reusable actionlint workflow
  • Loading branch information
jrfnl authored Dec 21, 2024
2 parents 256ce35 + 4d4fa80 commit 0d014e6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: QA

on:
# Run on all pushes and on all pull requests.
push:
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
actionlint:
name: 'Lint GH Action workflows'
uses: ./.github/workflows/reusable-actionlint.yml
with:
args: '-verbose'
41 changes: 41 additions & 0 deletions .github/workflows/reusable-actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: GH Actions Lint

on:
workflow_call:
inputs:
shellcheck:
description: 'Whether to enable shellcheck. Defaults to enabled.'
type: boolean
required: false
default: true
pyflakes:
description: 'Whether to enable pyflakes. Defaults to enabled.'
type: boolean
required: false
default: true
args:
description: 'Command line arguments to pass to the actionlint command.'
type: string
required: false
default: ''

jobs:
actionlint:
name: 'Actionlint'
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 ${{ inputs.args }} ${{ inputs.shellcheck == false && '-shellcheck=' || '' }} ${{ inputs.pyflakes == false && '-pyflakes=' || '' }}

0 comments on commit 0d014e6

Please sign in to comment.