Skip to content

Commit f1824de

Browse files
authored
security(ci): harden workflows and add zizmor audit (#572)
1 parent dbceda9 commit f1824de

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3434
with:
3535
fetch-depth: 0
36+
persist-credentials: false
3637

3738
- name: Install pnpm
3839
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
@@ -71,6 +72,7 @@ jobs:
7172
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
7273
with:
7374
fetch-depth: 0
75+
persist-credentials: false
7476

7577
- name: Install pnpm
7678
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
@@ -115,6 +117,7 @@ jobs:
115117
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
116118
with:
117119
fetch-depth: 0
120+
persist-credentials: false
118121

119122
- name: Install pnpm
120123
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0

.github/workflows/nightly-release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
branches:
1010
- main
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
release:
1417
runs-on: ubuntu-latest
@@ -18,6 +21,7 @@ jobs:
1821
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
1922
with:
2023
fetch-depth: 0
24+
persist-credentials: false
2125

2226
- name: Install pnpm
2327
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout codes
18+
# zizmor: ignore[artipacked] needs persisted credentials so that
19+
# stefanzweifel/git-auto-commit-action can push the changelog commit.
1820
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
1921
with:
2022
ref: ${{ github.head_ref }}
@@ -39,14 +41,16 @@ jobs:
3941
separator: '/'
4042

4143
- name: Create Github Release
42-
run: gh release create ${{ steps.split.outputs._2 }} --generate-notes
44+
run: gh release create "$TAG" --generate-notes
4345
env:
4446
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
TAG: ${{ steps.split.outputs._2 }}
4548

4649
- name: Generate changelog
47-
run: pnpx gh-changelogen --repo=intlify/bundle-tools --tag=${{ steps.split.outputs._2 }}
50+
run: pnpx gh-changelogen --repo=intlify/bundle-tools --tag="$TAG"
4851
env:
4952
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
TAG: ${{ steps.split.outputs._2 }}
5054

5155
- name: Commit changelog
5256
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0

.github/workflows/reproduire.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
types: [labeled]
55

66
permissions:
7+
contents: read
78
issues: write
89

910
jobs:
@@ -12,6 +13,8 @@ jobs:
1213
steps:
1314
- name: Checkout codes
1415
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
16+
with:
17+
persist-credentials: false
1518
- uses: Hebilicious/reproduire@4b686ae9cbb72dad60f001d278b6e3b2ce40a9ac # v0.0.9
1619
with:
1720
label: 'Status: Need More Info' # Optional, will default to this value.

0 commit comments

Comments
 (0)