Skip to content

Commit 169b6aa

Browse files
committed
Harden GitHub Actions via zizmor
1 parent d52b078 commit 169b6aa

2 files changed

Lines changed: 16 additions & 7 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: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: main
22
on: [ push, pull_request ]
3+
permissions:
4+
contents: read
5+
36
jobs:
47
test:
58
runs-on: ubuntu-latest
@@ -14,6 +17,8 @@ jobs:
1417
steps:
1518
- name: Checkout
1619
uses: actions/checkout@v6
20+
with:
21+
persist-credentials: false
1722

1823
- name: Setup PHP, with composer and extensions
1924
uses: shivammathur/setup-php@v2
@@ -45,6 +50,8 @@ jobs:
4550
steps:
4651
- name: Checkout
4752
uses: actions/checkout@v6
53+
with:
54+
persist-credentials: false
4855

4956
- name: Setup PHP, with composer and extensions
5057
uses: shivammathur/setup-php@v2
@@ -71,6 +78,8 @@ jobs:
7178
steps:
7279
- name: Checkout
7380
uses: actions/checkout@v6
81+
with:
82+
persist-credentials: false
7483

7584
- name: Setup PHP, with composer and extensions
7685
uses: shivammathur/setup-php@v2
@@ -97,13 +106,11 @@ jobs:
97106
steps:
98107
- uses: actions/checkout@v6
99108
with:
100-
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
101-
102-
- name: Get release info
103-
run: git tag --format '%(contents:body)' --points-at > release-body.txt
109+
persist-credentials: false
110+
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched, and we cannot get correct version
104111

105-
- uses: ncipollo/release-action@v1
112+
# Create release
113+
- name: Create release
106114
env:
107115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
108-
with:
109-
bodyFile: release-body.txt
116+
run: gh release create "$GITHUB_REF_NAME" --verify-tag --notes "$(git tag --format '%(contents:body)' --points-at)"

0 commit comments

Comments
 (0)