Skip to content

Commit

Permalink
Add actionlint
Browse files Browse the repository at this point in the history
Add a workflow to lint GitHub Actions workflows.
  • Loading branch information
martincostello committed Sep 4, 2023
1 parent 9ef832c commit 445c582
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
36 changes: 36 additions & 0 deletions .github/workflows/actions-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: actions-lint

on:
push:
branches: [ main ]
paths-ignore:
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
pull_request:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

env:
FORCE_COLOR: 3
TERM: xterm

jobs:
lint:
runs-on: ubuntu-latest

steps:

- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Add actionlint problem matcher
run: echo "::add-matcher::.github/actionlint-matcher.json"

- name: Lint workflows
uses: docker://rhysd/actionlint@sha256:86ebdb1c0df5a8be92b9d53e2e0c636978a2b3c6e52c86c65a77e2c78a6bd594 # v1.6.25
with:
args: -color

0 comments on commit 445c582

Please sign in to comment.