Skip to content

Commit 2497a7d

Browse files
authored
Merge pull request #156 from crazy-max/zizmor-reuse
ci: switch to reusable workflow to run zizmor
2 parents 489b6e8 + 7a04a20 commit 2497a7d

File tree

6 files changed

+17
-81
lines changed

6 files changed

+17
-81
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
cooldown:
8+
default-days: 2
79
open-pull-requests-limit: 10
10+
groups:
11+
crazy-max-dot-github:
12+
patterns:
13+
- "crazy-max/.github/*"
814
labels:
915
- "area/dependencies"
1016
- "bot"
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: .pr-assign-author
22

3-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
43
permissions:
54
contents: read
65

@@ -11,41 +10,8 @@ on:
1110
- reopened
1211

1312
jobs:
14-
assign-author:
15-
runs-on: ubuntu-24.04
13+
run:
14+
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@bb328ea508cd6a89d0865555ddbeb148e5724aed # v1.3.0
1615
permissions:
1716
contents: read
1817
pull-requests: write
19-
steps:
20-
-
21-
name: Assigning author to PR
22-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
23-
with:
24-
script: |
25-
try {
26-
const dt = context.payload?.pull_request;
27-
if (!dt) {
28-
throw new Error(`No pull request payload found, skipping.`);
29-
}
30-
31-
const { assignees, number, user: { login: author, type } } = dt;
32-
if (assignees.length > 0) {
33-
throw new Error(`Pull request is already assigned to someone, skipping.`);
34-
} else if (type !== 'User') {
35-
throw new Error(`Not a user, skipping.`);
36-
}
37-
38-
const respAdd = await github.rest.issues.addAssignees({
39-
...context.repo,
40-
issue_number: number,
41-
assignees: [author]
42-
});
43-
core.debug(`addAssignees resp: ${JSON.stringify(respAdd, null, 2)}`);
44-
if (respAdd.status !== 201) {
45-
throw new Error(`Failed to assign @${author} to the pull request #${number}.`);
46-
}
47-
48-
core.info(`@${author} has been assigned to the pull request #${number}`);
49-
} catch (e) {
50-
core.warning(e.message);
51-
}

.github/workflows/.test-bake.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: .test-bake
22

3-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
43
permissions:
54
contents: read
65

.github/workflows/.test-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: .test-build
22

3-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
43
permissions:
54
contents: read
65

.github/workflows/.zizmor.yml

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: .zizmor
22

3-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
43
permissions:
54
contents: read
65

@@ -16,50 +15,13 @@ on:
1615
- 'releases/v*'
1716
pull_request:
1817

19-
env:
20-
ZIZMOR_VERSION: 1.22.0 # https://github.com/zizmorcore/zizmor
21-
2218
jobs:
2319
zizmor:
24-
runs-on: ubuntu-24.04
20+
uses: crazy-max/.github/.github/workflows/zizmor.yml@bb328ea508cd6a89d0865555ddbeb148e5724aed # v1.3.0
2521
permissions:
2622
contents: read
2723
security-events: write
28-
env:
29-
TMPDIR: /tmp/zizmor
30-
steps:
31-
-
32-
name: Checkout
33-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34-
with:
35-
persist-credentials: false
36-
-
37-
name: Setup uv
38-
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
39-
with:
40-
enable-cache: false
41-
-
42-
name: Install zizmor
43-
run: |
44-
set -ex
45-
uv tool install zizmor@${ZIZMOR_VERSION}
46-
-
47-
name: Run zizmor
48-
id: zizmor
49-
run: |
50-
mkdir -p ${TMPDIR}
51-
set -ex
52-
zizmor --min-severity=medium --min-confidence=medium --persona=pedantic --no-online-audits --format=sarif . > ${TMPDIR}/zizmor.sarif
53-
env:
54-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
-
56-
name: Zizmor crash report
57-
if: ${{ failure() && steps.zizmor.conclusion == 'failure' }}
58-
run: |
59-
cat ${TMPDIR}/report-*.toml
60-
-
61-
name: Upload SARIF report
62-
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
63-
with:
64-
sarif_file: ${{ env.TMPDIR }}/zizmor.sarif
65-
category: zizmor
24+
with:
25+
min-severity: medium
26+
min-confidence: medium
27+
persona: pedantic

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ rules:
77
- bake.yml
88
- build.yml
99
- verify.yml
10+
11+
# FIXME: remove this rule when zizmor 1.24.0 is released, fixing the right persona attached to this rule: https://github.com/zizmorcore/zizmor/pull/1783
12+
secrets-outside-env:
13+
disable: true

0 commit comments

Comments
 (0)