Skip to content

Commit aec2927

Browse files
committed
fix: improve PAT_TOKEN handling and debugging in release workflow
- Add comprehensive debug output for token availability - Fix environment variable access in git configuration step - Use proper env vars instead of direct secret interpolation in shell - Add explicit git remote verification steps These changes should resolve the PAT_TOKEN not being recognized properly, enabling bypass of branch protection rules in future releases.
1 parent b777ddc commit aec2927

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/cargo-workspaces-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,20 @@ jobs:
7474
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
7575

7676
- name: Configure git
77+
env:
78+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7780
run: |
7881
git config user.name "github-actions[bot]"
7982
git config user.email "github-actions[bot]@users.noreply.github.com"
8083
8184
# Configure git remote to use PAT_TOKEN for pushes
82-
if [ -n "${{ secrets.PAT_TOKEN }}" ]; then
85+
if [ -n "$PAT_TOKEN" ]; then
8386
echo "Configuring git to use PAT_TOKEN for pushes"
84-
git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git
87+
git remote set-url origin https://x-access-token:[email protected]/${{ github.repository }}.git
8588
else
8689
echo "PAT_TOKEN not available, using GITHUB_TOKEN"
87-
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
90+
git remote set-url origin https://x-access-token:[email protected]/${{ github.repository }}.git
8891
fi
8992
9093
echo "Final git remote configuration:"

0 commit comments

Comments
 (0)