Skip to content

Commit b0278f3

Browse files
authored
chore: bot auth for release (#416)
1 parent e2bc37e commit b0278f3

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/prod_release.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,35 @@ jobs:
1010
prod_release:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Clone repository
14-
uses: actions/checkout@v3
13+
- name: Generate bot token
14+
uses: actions/create-github-app-token@v1
15+
id: app_token
1516
with:
17+
app-id: ${{ secrets.BOT_ID }}
18+
private-key: ${{ secrets.BOT_SK }}
19+
20+
- uses: actions/checkout@v4
21+
with:
22+
# Fetch entire repository history so we can determine version number from it
1623
fetch-depth: 0
24+
token: ${{ steps.app_token.outputs.token }}
25+
26+
- name: Set Git user as GitHub actions
27+
run: git config --global user.email "179917785+engineering-ci[bot]@users.noreply.github.com" && git config --global user.name "engineering-ci[bot]"
28+
1729
- name: Merge main -> release
1830
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f
1931
with:
2032
type: now
2133
from_branch: main
2234
target_branch: release
23-
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
github_token: ${{ steps.app_token.outputs.token }}
36+
2437
- name: Merge release -> main
2538
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f
2639
with:
2740
type: now
2841
from_branch: release
2942
target_branch: main
3043
message: Merge release back to main to get version increment [no ci]
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
github_token: ${{ steps.app_token.outputs.token }}

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@ jobs:
6060
needs: build
6161
runs-on: ubuntu-latest
6262
steps:
63-
- name: Clone repository
64-
uses: actions/checkout@v3
63+
- name: Generate bot token
64+
uses: actions/create-github-app-token@v1
65+
id: app_token
6566
with:
67+
app-id: ${{ secrets.BOT_ID }}
68+
private-key: ${{ secrets.BOT_SK }}
69+
70+
- uses: actions/checkout@v4
71+
with:
72+
# Fetch entire repository history so we can determine version number from it
6673
fetch-depth: 0
74+
token: ${{ steps.app_token.outputs.token }}
75+
76+
- name: Set Git user as GitHub actions
77+
run: git config --global user.email "179917785+engineering-ci[bot]@users.noreply.github.com" && git config --global user.name "engineering-ci[bot]"
6778

6879
# semantic-release needs node 20
6980
- name: Use Node.js 20.x
@@ -89,5 +100,5 @@ jobs:
89100
- name: 'Semantic release'
90101
run: npx semantic-release
91102
env:
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
93104
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)