Skip to content

Commit 9648245

Browse files
committed
Fix GitHub Actions permissions for gh-pages deployment
- Change contents permission from read to write to allow pushing to gh-pages branch - Add force_orphan: true to handle first-time gh-pages branch creation - Resolves 403 permission denied error when pushing to gh-pages branch - Ensures GitHub Actions can create and push to gh-pages branch
1 parent 4a0b783 commit 9648245

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
88
permissions:
9-
contents: read
9+
contents: write
1010
pages: write
1111
id-token: write
1212

@@ -47,3 +47,4 @@ jobs:
4747
with:
4848
github_token: ${{ secrets.GITHUB_TOKEN }}
4949
publish_dir: ./build
50+
force_orphan: true

0 commit comments

Comments
 (0)