Skip to content

Commit 5f0e90f

Browse files
committed
fix: One last verification of the token
1 parent c261711 commit 5f0e90f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build-image.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
- name: Output GitHub API JSON with GITHUB_TOKEN
5151
if: always()
5252
run: |
53-
echo "Full JSON response from GitHub API /user endpoint using GITHUB_TOKEN:"
54-
user_json=$(curl -sS -D headers.txt -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/user)
55-
echo "$user_json" | jq . || cat
53+
echo "Full JSON response from GitHub API /repos/:owner/:repo endpoint using GITHUB_TOKEN (should always work):"
54+
repo_json=$(curl -sS -D headers.txt -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
55+
"https://api.github.com/repos/${{ github.repository }}")
56+
echo "$repo_json" | jq . || cat
5657
echo
57-
echo "Response headers from /user endpoint as JSON:"
58-
# Convert headers to JSON (simple key-value, not handling multi-line headers)
58+
echo "Response headers from /repos/:owner/:repo endpoint as JSON:"
5959
awk -F': ' 'NF==2{gsub(/\r/,"",$2); printf "\"%s\": \"%s\",\n", $1, $2}' headers.txt | \
6060
sed '$ s/,$//' | \
6161
awk 'BEGIN{print "{"} {print} END{print "}"}'

0 commit comments

Comments
 (0)