Skip to content

Commit 80f8d7a

Browse files
authored
Backport Permissions (#2937)
1 parent e8c28e7 commit 80f8d7a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/pr-backport-autotrigger.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: write
9+
actions: write # Allows the workflow to trigger other workflows on push
910

1011
jobs:
1112
backport:
@@ -19,9 +20,10 @@ jobs:
1920

2021
- name: Set up Git
2122
run: |
22-
git config --global user.name "github-actions[bot]"
23-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
24-
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
23+
git config --global user.name "yuhongsun96"
24+
git config --global user.email "yuhongsun96@gmail.com"
25+
# Configure Git to use the PAT for authentication
26+
git remote set-url origin https://yuhongsun96:${{ secrets.YUHONG_GH_ACTIONS }}@github.com/${{ github.repository }}.git
2527
2628
- name: Check for Backport Checkbox
2729
id: checkbox-check
@@ -80,7 +82,7 @@ jobs:
8082
# Create new beta tag
8183
git tag ${{ steps.list-branches.outputs.new_beta_tag }}
8284
# Push the changes and tag to the beta branch
83-
git push origin ${{ steps.list-branches.outputs.beta }}
85+
git push origin ${{ steps.list-branches.outputs.beta }} --force
8486
git push origin ${{ steps.list-branches.outputs.new_beta_tag }}
8587
# Checkout the stable branch
8688
git checkout ${{ steps.list-branches.outputs.stable }}
@@ -92,5 +94,5 @@ jobs:
9294
# Create new stable tag
9395
git tag ${{ steps.list-branches.outputs.new_stable_tag }}
9496
# Push the changes and tag to the stable branch
95-
git push origin ${{ steps.list-branches.outputs.stable }}
96-
git push origin ${{ steps.list-branches.outputs.new_stable_tag }}
97+
git push origin ${{ steps.list-branches.outputs.stable }} --force
98+
git push origin ${{ steps.list-branches.outputs.new_stable_tag }}

0 commit comments

Comments
 (0)