Skip to content

Commit 043327d

Browse files
committed
[CI] Add a github action linter.
The linter checks all action configs in the .github/workflows folder.
1 parent cc9aa10 commit 043327d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/actionlint.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
self-hosted-runner:
2+
# Labels of self-hosted runner in array of strings.
3+
labels: [mac14, mac15, mac26, mac-beta, cpu]
4+
5+
# Configuration variables in array of strings defined in your repository or
6+
# organization. `null` means disabling configuration variables check.
7+
# Empty array means no configuration variable is allowed.
8+
config-variables: null
9+
10+
# Configuration for file paths. The keys are glob patterns to match to file
11+
# paths relative to the repository root. The values are the configurations for
12+
# the file paths. Note that the path separator is always '/'.
13+
# The following configurations are available.
14+
#
15+
# "ignore" is an array of regular expression patterns. Matched error messages
16+
# are ignored. This is similar to the "-ignore" command line option.
17+
paths:
18+
# .github/workflows/**/*.yml:
19+
# ignore: []
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Lint Github Action Files'
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
paths:
8+
- '.github/workflows/*.yml'
9+
10+
jobs:
11+
lint-action-files:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: actionlint
18+
uses: raven-actions/actionlint@v2
19+
with:
20+
files: '.github/workflows/*.yml'
21+
fail-on-error: false
22+
flags: '-ignore SC2046 -ignore SC2086' # Variable quoting error in shellcheck

0 commit comments

Comments
 (0)