File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,23 @@ jobs:
6060 # with --allowerasing
6161 dnf install curl --allowerasing -y
6262
63- - name : Verify token permissions
64- env :
65- GH_TOKEN : ${{ steps.generate-token.outputs.token }}
63+ - name : Check if token can push
6664 run : |
67- echo "Verifying token permissions by inspecting API response headers..."
68- gh api -i /
65+ REPO_PERMS=$(curl -s -H "Authorization: Bearer ${{ steps.generate-token.outputs.token }}" \
66+ -H "Accept: application/vnd.github+json" \
67+ "https://api.github.com/repos/${{ github.repository }}" \
68+ | jq -r '.permissions')
69+
70+ PUSH_ALLOWED=$(echo "$REPO_PERMS" | jq -r '.push')
71+
72+ if [ "$PUSH_ALLOWED" == "true" ]; then
73+ echo "✓ Token has push permissions"
74+ else
75+ echo "✗ Token does NOT have push permissions. Full permissions object: $REPO_PERMS"
76+ exit 1
77+ fi
78+
79+
6980
7081 - name : Checkout kernel-src-tree
7182 uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments