Skip to content

Commit 0dc8374

Browse files
committed
Harden GitHub Actions via zizmor
1 parent 028a843 commit 0dc8374

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ updates:
44
directory: '/'
55
schedule:
66
interval: monthly
7+
cooldown:
8+
default-days: 7
79
open-pull-requests-limit: 10
810
ignore:
911
- dependency-name: '*'

.github/workflows/main.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: main
22
on: [push, pull_request]
3+
permissions:
4+
contents: read
35

46
jobs:
57
build:
68
runs-on: ubuntu-latest
79
steps:
810
- uses: actions/checkout@v6
911
with:
12+
persist-credentials: false
1013
fetch-depth: 0 # Need all tags to get a version number in-between tags
1114
- uses: pnpm/action-setup@v6
1215
- uses: actions/setup-node@v6
@@ -24,6 +27,8 @@ jobs:
2427
runs-on: ubuntu-latest
2528
steps:
2629
- uses: actions/checkout@v6
30+
with:
31+
persist-credentials: false
2732
- uses: pnpm/action-setup@v6
2833
- uses: actions/setup-node@v6
2934
with:
@@ -38,6 +43,8 @@ jobs:
3843
runs-on: ubuntu-latest
3944
steps:
4045
- uses: actions/checkout@v6
46+
with:
47+
persist-credentials: false
4148
- uses: pnpm/action-setup@v6
4249
- uses: actions/setup-node@v6
4350
with:
@@ -50,6 +57,8 @@ jobs:
5057
runs-on: ubuntu-latest
5158
steps:
5259
- uses: actions/checkout@v6
60+
with:
61+
persist-credentials: false
5362
- uses: pnpm/action-setup@v6
5463
- uses: actions/setup-node@v6
5564
with:
@@ -85,6 +94,7 @@ jobs:
8594
steps:
8695
- uses: actions/checkout@v6
8796
with:
97+
persist-credentials: false
8898
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
8999
- uses: actions/download-artifact@v8
90100
with:
@@ -101,10 +111,7 @@ jobs:
101111
- run: pnpm publish --provenance --no-git-checks dist/fab-speed-dial/
102112

103113
# Create release
104-
- name: Get release info
105-
run: git tag --format '%(contents:body)' --points-at > release-body.txt
106-
- uses: ncipollo/release-action@v1
114+
- name: Create release
107115
env:
108116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
109-
with:
110-
bodyFile: release-body.txt
117+
run: gh release create "$GITHUB_REF_NAME" --verify-tag --notes "$(git tag --format '%(contents:body)' --points-at)"

0 commit comments

Comments
 (0)