Skip to content

Commit 002e0d7

Browse files
author
khalidaboelmagd
committed
ci: use built-in GITHUB_TOKEN with contents:write perm, drop GH_PAT dep
The user's GH_PAT secret kept producing 403s on release creation (the token showed 'never used' in GitHub — likely the secret was never actually saved with the regenerated value). Sidestep the secret entirely: GitHub Actions exposes a built-in GITHUB_TOKEN automatically whose permissions can be declared at the workflow level. Grant contents:write and the softprops/action-gh-release action picks it up as the default GITHUB_TOKEN. No user-managed PAT needed.
1 parent 7acf9c2 commit 002e0d7

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/kernelsu-oos11.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env:
1818
CCACHE_MAXSIZE: "2G"
1919
CCACHE_HARDLINK: "true"
2020

21+
permissions:
22+
contents: write # required for softprops/action-gh-release to create releases
23+
2124
jobs:
2225
build:
2326
runs-on: ubuntu-latest
@@ -120,10 +123,6 @@ jobs:
120123
path: OP7-OOS11-KSUN-*.zip
121124

122125
- name: Release
123-
# Release requires a PAT with contents:write. If the token lacks
124-
# that scope the step errors but the artifact has already been
125-
# uploaded in the previous step, so do not fail the whole run.
126-
continue-on-error: true
127126
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
128127
uses: softprops/action-gh-release@v2
129128
with:
@@ -135,5 +134,5 @@ jobs:
135134
Target: OxygenOS 11
136135
KernelSU-Next: ${{ env.KSU_NEXT_TAG }}
137136
SUSFS: disabled (add in follow-up once root grant is stable)
138-
env:
139-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
137+
# Uses the built-in GITHUB_TOKEN (granted contents:write at the
138+
# workflow level above). No repo secret required.

0 commit comments

Comments
 (0)