Skip to content

Commit c2ae031

Browse files
committed
Fix GitHub release permissions in PyPI workflow
- Add contents: write and packages: write permissions - Add GITHUB_TOKEN environment variable for authentication - Should resolve 403 error when creating GitHub releases
1 parent 05c0eb3 commit c2ae031

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/pypi-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
packages: write
1114
steps:
1215
- name: Checkout code
1316
uses: actions/checkout@v3
@@ -41,6 +44,8 @@ jobs:
4144
- name: Create GitHub Release
4245
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
4346
uses: softprops/action-gh-release@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4449
with:
4550
tag_name: ${{ github.ref_name }}
4651
name: Release ${{ github.ref_name }}

0 commit comments

Comments
 (0)