Skip to content

Commit 6ffc460

Browse files
authored
Change GITHUB_TOKEN to user-created GH_PAT (#125)
Fixes permission issues where GH api responds with: ```swift gh: Resource not accessible by integration (HTTP 403) {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/git/refs#create-a-reference"} Error: Process completed with exit code 1. ``` because the default, auto-created GITHUB_TOKEN cannot be given appropriate content write permissions to create branches in the owner's repository
1 parent db751fe commit 6ffc460

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build_loop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Check for alive branch
5454
if: steps.workflow-permission.outputs.has_permission == 'true'
5555
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
5757
run: |
5858
if [[ "$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository_owner }}/LoopWorkspace/branches | jq --raw-output 'any(.name=="alive")')" == "true" ]]; then
5959
echo "Branch 'alive' exists."
@@ -66,7 +66,7 @@ jobs:
6666
- name: Create alive branch
6767
if: env.ALIVE_BRANCH_EXISTS == 'false'
6868
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
7070
run: |
7171
# Get ref for LoopKit/LoopWorkspace:dev
7272
SHA=$(curl -sS https://api.github.com/repos/${{ env.UPSTREAM_REPO }}/git/refs \

0 commit comments

Comments
 (0)