Skip to content

Commit 9f5d582

Browse files
committed
ci: update_urls: backport GitHub token usage
1 parent ce0f8fb commit 9f5d582

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/update_urls.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ permissions: {}
1414
jobs:
1515
update_urls:
1616
runs-on: ubuntu-24.04
17+
env:
18+
GH_TOKEN: ${{ github.token }}
1719
permissions:
1820
contents: write
1921
pull-requests: write
@@ -22,26 +24,26 @@ jobs:
2224
- uses: actions/checkout@v4
2325
with:
2426
ref: dev
27+
fetch-depth: 0
2528

2629
- name: Switch to update_urls branch
2730
run: |
31+
git config user.name 'github-actions[bot]'
32+
git config user.email 'github-actions[bot]@users.noreply.github.com'
2833
if git fetch origin update_urls 2> /dev/null
2934
then
3035
git switch update_urls
36+
git rebase dev
3137
else
3238
git checkout -b update_urls
3339
fi
3440
3541
- run: bash .github/workflows/update_urls.bash
3642

3743
- name: Commit changes
38-
env:
39-
GH_TOKEN: ${{ github.token }}
4044
run: |
4145
git diff --exit-code && exit 0
4246
git add -A
43-
git config user.name 'github-actions[bot]'
44-
git config user.email 'github-actions[bot]@users.noreply.github.com'
4547
if git fetch origin update_urls 2> /dev/null
4648
then
4749
git commit --amend --no-edit

0 commit comments

Comments
 (0)