Skip to content

Commit 1e4c402

Browse files
committed
Use PAT for runner registration instead of GITHUB_TOKEN
1 parent 9c936bd commit 1e4c402

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ jobs:
6363
id: reg-token
6464
run: |
6565
RESPONSE=$(curl -sS -X POST \
66-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
66+
-H "Authorization: Bearer ${{ secrets.GH_RUNNER_TOKEN }}" \
6767
-H "Accept: application/vnd.github+json" \
6868
-H "X-GitHub-Api-Version: 2022-11-28" \
6969
"https://api.github.com/repos/${{ github.repository }}/actions/runners/registration-token")
70-
echo "$RESPONSE" | jq .
71-
TOKEN=$(echo "$RESPONSE" | jq -r .token)
72-
test "$TOKEN" != "null"
73-
test -n "$TOKEN"
70+
TOKEN=$(echo "$RESPONSE" | jq -r '.token')
71+
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
72+
echo "Failed to get runner token"
73+
echo "$RESPONSE" | jq .
74+
exit 1
75+
fi
7476
echo "token=$TOKEN" >> "$GITHUB_OUTPUT"
7577
7678
- name: Launch EC2 instance

0 commit comments

Comments
 (0)