fix: add permissions and authentication for promotion workflow

- Add contents:write permission for GitHub Actions
- Configure git to use GITHUB_TOKEN for authentication
- Set remote URL with access token for push operations
- This should resolve the 403 permission denied error
This commit is contained in:
Brian Madison
2025-08-15 20:25:12 -05:00
parent 8b0b72b7b4
commit 7f016d0020

View File

@@ -16,6 +16,9 @@ on:
jobs:
promote:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
@@ -34,6 +37,7 @@ jobs:
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Switch to stable branch
run: |
@@ -103,7 +107,9 @@ jobs:
- Automated promotion via GitHub Actions"
- name: Push stable release
run: git push origin stable
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin stable
- name: Switch back to main
run: git checkout main