Skip to content

Commit 191f090

Browse files
committed
ci(zstd): add debug step to inspect upload URL and token length before asset upload
- Introduce “Debug upload context” step to echo the release `upload_url` and `GITHUB_TOKEN` length - Helps diagnose “Bad credentials” by verifying PAT injection and correct upload endpoint Signed-off-by: Srikanth Muppandam <[email protected]>
1 parent cf9e24b commit 191f090

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/zstd.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Zstd Archive Release
22

3-
# Grant the GITHUB_TOKEN write access so we can create releases & upload assets
3+
# Grant write access so we can create releases & upload assets
44
permissions:
55
contents: write
66

77
on:
88
push:
9-
# Trigger on semver tags like v1.2.3
9+
# Only run on semver-style tags like v1.2.3
1010
tags:
1111
- 'v*.*.*'
12-
workflow_dispatch: # allow manual runs
12+
workflow_dispatch: # (Optional) allows manual runs
1313

1414
jobs:
1515
release:
@@ -37,12 +37,19 @@ jobs:
3737
"${{ steps.version.outputs.tag_name }}" \
3838
| zstd -o "${GITHUB_WORKSPACE}/${{ steps.version.outputs.tag_name }}.tar.zst"
3939
40+
- name: Debug upload context
41+
run: |
42+
echo "UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }}"
43+
echo "GITHUB_TOKEN length: ${#GITHUB_TOKEN}"
44+
# ensure this uses your PAT
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.PAT }}
47+
4048
- name: Create GitHub Release
4149
id: create_release
4250
uses: actions/create-release@v1
4351
env:
44-
# use your PAT stored in 'PAT' secret
45-
GITHUB_TOKEN: ${{ secrets.PAT }}
52+
GITHUB_TOKEN: ${{ secrets.PAT }} # your PAT secret with repo scope
4653
with:
4754
tag_name: ${{ steps.version.outputs.tag_name }}
4855
release_name: Release ${{ steps.version.outputs.tag_name }}
@@ -51,10 +58,10 @@ jobs:
5158

5259
- name: Upload .tar.zst to GitHub Release
5360
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.PAT }} # same PAT here
5463
with:
5564
upload_url: ${{ steps.create_release.outputs.upload_url }}
5665
asset_path: ${{ github.workspace }}/${{ steps.version.outputs.tag_name }}.tar.zst
5766
asset_name: ${{ steps.version.outputs.tag_name }}.tar.zst
5867
asset_content_type: application/zstd
59-
# pass the same PAT for authentication
60-
token: ${{ secrets.PAT }}

0 commit comments

Comments
 (0)