Skip to content

Commit 13fbae6

Browse files
committed
fix(security): verify release attestations and restrict Pages permissions
1 parent 28de702 commit 13fbae6

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎.github/workflows/pages.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ on:
1616

1717
permissions:
1818
contents: read
19-
pages: write
20-
id-token: write
2119

2220
concurrency:
2321
group: "pages"
@@ -45,6 +43,10 @@ jobs:
4543
path: ./_site
4644

4745
deploy:
46+
permissions:
47+
contents: read
48+
pages: write
49+
id-token: write
4850
environment:
4951
name: github-pages
5052
url: ${{ steps.deployment.outputs.page_url }}

‎action.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ runs:
118118
--pattern "$archive" --pattern checksums.txt
119119
(cd "$dl" && if command -v sha256sum > /dev/null; then sha256sum --check --ignore-missing checksums.txt; \
120120
else shasum -a 256 --check --ignore-missing checksums.txt; fi)
121+
# Checksums and archive can be replaced together. Provenance binds
122+
# this exact archive to the repository's trusted release workflow.
123+
gh attestation verify "$dl/$archive" --repo TMHSDigital/subenum
121124
if [ "$ext" = zip ]; then unzip -o -q "$dl/$archive" -d "$dl/x"; else mkdir -p "$dl/x" && tar -xzf "$dl/$archive" -C "$dl/x"; fi
122125
find "$dl/x" -maxdepth 2 -name 'subenum*' -type f \( -name subenum -o -name subenum.exe \) -exec cp {} "$bin/" \;
123126
fi

0 commit comments

Comments
 (0)