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:
8
.github/workflows/promote-to-stable.yml
vendored
8
.github/workflows/promote-to-stable.yml
vendored
@@ -16,6 +16,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
promote:
|
promote:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -34,6 +37,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
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
|
- name: Switch to stable branch
|
||||||
run: |
|
run: |
|
||||||
@@ -103,7 +107,9 @@ jobs:
|
|||||||
- Automated promotion via GitHub Actions"
|
- Automated promotion via GitHub Actions"
|
||||||
|
|
||||||
- name: Push stable release
|
- 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
|
- name: Switch back to main
|
||||||
run: git checkout main
|
run: git checkout main
|
||||||
|
|||||||
Reference in New Issue
Block a user