Skip to content

Commit ff93f5d

Browse files
committed
Use two token in parallel
1 parent 410c6d3 commit ff93f5d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/prerelease-changelog-update.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
secrets:
66
BOT_TOKEN:
7-
required: true
7+
required: false
88
release:
99
types: [prereleased]
1010

@@ -31,7 +31,7 @@ jobs:
3131
#
3232
uses: actions/checkout@v4
3333
with:
34-
token: ${{ secrets.BOT_TOKEN }}
34+
token: ${{ secrets.BOT_TOKEN || github.token }}
3535
ref: ${{ github.event.release.target_commitish }}
3636

3737
- name: Update Changelog
@@ -96,7 +96,7 @@ jobs:
9696
- name: Push to protected branch
9797
uses: CasperWA/push-protected@v2
9898
with:
99-
token: ${{ secrets.BOT_TOKEN }}
99+
token: ${{ secrets.BOT_TOKEN || github.token }}
100100
# branch: ${{ github.event.release.target_commitish }}
101101
branch: main
102102
#unprotect_reviews: true # has anoying side-effect: settings stays disabled if workflow fails
@@ -112,7 +112,7 @@ jobs:
112112
- name: Checkout code
113113
uses: actions/checkout@v4
114114
with:
115-
token: ${{ secrets.BOT_TOKEN }}
115+
token: ${{ secrets.BOT_TOKEN || github.token }}
116116
ref: 'main'
117117

118118
- name: Get latest commit ID
@@ -124,13 +124,13 @@ jobs:
124124
- uses: jimeh/update-tags-action@v1
125125
with:
126126
tags: ${{ github.event.release.tag_name }},latest
127-
github_token: ${{ secrets.BOT_TOKEN }}
127+
github_token: ${{ secrets.BOT_TOKEN || github.token }}
128128
ref: ${{ env.LATEST_COMMIT_ID }}
129129

130130
- name: publish pre-Release as Release
131131
uses: actions/github-script@v7
132132
with:
133-
github-token: ${{ secrets.BOT_TOKEN }}
133+
github-token: ${{ secrets.BOT_TOKEN || github.token }}
134134
script: |
135135
const { owner, repo } = context.repo;
136136
const release = await github.rest.repos.getReleaseByTag({

0 commit comments

Comments
 (0)