Skip to content

Commit d046099

Browse files
committed
Harden GitHub Actions via zizmor
1 parent 2d6b24c commit d046099

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
@@ -13,6 +16,8 @@ jobs:
1316
steps:
1417
- name: Checkout
1518
uses: actions/checkout@v6
19+
with:
20+
persist-credentials: false
1621

1722
- name: Setup PHP, with composer and extensions
1823
uses: shivammathur/setup-php@v2
@@ -44,6 +49,8 @@ jobs:
4449
steps:
4550
- name: Checkout
4651
uses: actions/checkout@v6
52+
with:
53+
persist-credentials: false
4754

4855
- name: Setup PHP, with composer and extensions
4956
uses: shivammathur/setup-php@v2
@@ -70,6 +77,8 @@ jobs:
7077
steps:
7178
- name: Checkout
7279
uses: actions/checkout@v6
80+
with:
81+
persist-credentials: false
7382

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

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

0 commit comments

Comments
 (0)