Skip to content

Commit c5e134f

Browse files
authored
Add a new GitHub action to lint workflows (#52)
* Add lint-workflows.yml * Fix actions/checkout * Fix permissions for simple workflows
1 parent 8f23447 commit c5e134f

2 files changed

Lines changed: 51 additions & 2 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Lint workflows
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [main]
10+
paths:
11+
- ".github/workflows/**"
12+
- ".github/actions/**"
13+
pull_request:
14+
branches: ["**"]
15+
paths:
16+
- ".github/workflows/**"
17+
- ".github/actions/**"
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
actionlint:
24+
name: actionlint
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 5
27+
steps:
28+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
29+
with:
30+
persist-credentials: false
31+
- uses: raven-actions/actionlint@205b530c5d9fa8f44ae9ed59f341a0db994aa6f8 # v2.1.2
32+
33+
zizmor:
34+
name: zizmor
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 5
37+
permissions:
38+
security-events: write
39+
steps:
40+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
41+
with:
42+
persist-credentials: false
43+
- uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ on:
99
pull_request:
1010
branches: ["**"]
1111

12+
permissions: {}
13+
1214
jobs:
1315
check:
1416
name: Test and lint
1517
runs-on: ubuntu-latest
1618
timeout-minutes: 30
1719

1820
steps:
19-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
22+
with:
23+
persist-credentials: false
2024

2125
- name: Node setup
2226
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
@@ -30,7 +34,9 @@ jobs:
3034
npm i
3135
npm run build
3236
- name: Publish package for testing branch
33-
run: npx pkg-pr-new publish || echo "Have you set up pkg-pr-new for this repo?"
37+
run:
38+
npx pkg-pr-new publish || echo "Have you set up pkg-pr-new for this
39+
repo?"
3440
- name: Test
3541
run: |
3642
npm run test

0 commit comments

Comments
 (0)