File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments