File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -120,25 +120,45 @@ jobs:
120
120
if : always()
121
121
122
122
build-publish :
123
+ permissions :
124
+ contents : write
125
+ issues : write
126
+ pull-requests : write
123
127
runs-on : ubuntu-latest
124
128
needs :
125
129
- lint
126
130
- test
127
131
steps :
132
+ - name : Generate release bot app token
133
+ id : generate_token
134
+ uses : actions/create-github-app-token@v1
135
+ with :
136
+ app-id : ${{ secrets.HIROSYSTEMS_RELEASE_BOT_ID }}
137
+ private-key : ${{ secrets.HIROSYSTEMS_RELEASE_BOT_PEM }}
138
+
128
139
- uses : actions/checkout@v4
129
140
with :
130
141
token : ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
131
142
fetch-depth : 0
132
143
persist-credentials : false
133
144
145
+ - name : Get bot user ID
146
+ id : bot-user-id
147
+ run : |
148
+ echo "user-id=$(gh api "/users/${{ steps.generate_token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
149
+ env :
150
+ GH_TOKEN : ${{ steps.generate_token.outputs.token }}
151
+
134
152
- name : Semantic Release
135
153
uses : cycjimmy/semantic-release-action@v4
136
154
id : semantic
137
155
# Only run on non-PR events or only PRs that aren't from forks
138
156
if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
139
157
env :
140
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
158
+ GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
141
159
SEMANTIC_RELEASE_PACKAGE : ${{ github.event.repository.name }}
160
+ GIT_AUTHOR_EMAIL : " ${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
161
+ GIT_COMMITTER_EMAIL : " ${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
142
162
with :
143
163
semantic_version : 19
144
164
extra_plugins : |
You can’t perform that action at this time.
0 commit comments