File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -105,16 +105,33 @@ jobs:
105
105
if : always()
106
106
107
107
build-publish :
108
+ permissions :
109
+ contents : write
110
+ issues : write
111
+ pull-requests : write
108
112
runs-on : ubuntu-latest
109
113
needs :
110
114
- lint
111
115
- test
112
116
steps :
117
+ - name : Generate release bot app token
118
+ id : generate_token
119
+ uses : actions/create-github-app-token@v1
120
+ with :
121
+ app-id : ${{ secrets.HIROSYSTEMS_RELEASE_BOT_ID }}
122
+ private-key : ${{ secrets.HIROSYSTEMS_RELEASE_BOT_PEM }}
123
+
113
124
- uses : actions/checkout@v4
114
125
with :
115
126
token : ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
116
127
fetch-depth : 0
117
128
persist-credentials : false
129
+ - name : Get bot user ID
130
+ id : bot-user-id
131
+ run : |
132
+ echo "user-id=$(gh api "/users/${{ steps.generate_token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
133
+ env :
134
+ GH_TOKEN : ${{ steps.generate_token.outputs.token }}
118
135
119
136
- uses : actions/setup-node@v4
120
137
with :
@@ -131,9 +148,11 @@ jobs:
131
148
# Only run on non-PR events or only PRs that aren't from forks
132
149
if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
133
150
env :
134
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
151
+ GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
135
152
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
136
153
SEMANTIC_RELEASE_PACKAGE : ${{ github.event.repository.name }}
154
+ GIT_AUTHOR_EMAIL : " ${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
155
+ GIT_COMMITTER_EMAIL : " ${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
137
156
with :
138
157
semantic_version : 19
139
158
extra_plugins : |
You can’t perform that action at this time.
0 commit comments