Skip to content

Commit c715f03

Browse files
committed
Add Actionlint
1 parent 00a570e commit c715f03

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/actionlint-matcher.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"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)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/workflows/lint-js-and-ruby.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,14 @@ jobs:
6565
run: yarn start format.listDifferent
6666
- name: Type-check TypeScript
6767
run: yarn run type-check
68+
- name: Lint GitHub Actions
69+
# We only download and run Actionlint if there is any difference in GitHub Action workflows
70+
# https://github.com/rhysd/actionlint/blob/main/docs/usage.md#on-github-actions
71+
run: |
72+
git fetch origin ${{ github.event.pull_request.base.sha }}
73+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q '^.github/workflows'; then
74+
echo "::add-matcher::.github/actionlint-matcher.json"
75+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
76+
SHELLCHECK_OPTS="-S warning" ./actionlint -color
77+
fi
78+
shell: bash

0 commit comments

Comments
 (0)