@@ -29,7 +29,8 @@ permissions:
29
29
jobs :
30
30
automation :
31
31
uses : ./.github/workflows/automation.yml
32
- secrets : inherit
32
+ secrets :
33
+ OTELBOT_DOTNET_PRIVATE_KEY : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
33
34
34
35
prepare-release-pr :
35
36
runs-on : ubuntu-22.04
@@ -38,18 +39,22 @@ jobs:
38
39
39
40
if : github.event_name == 'workflow_dispatch' && needs.automation.outputs.enabled
40
41
41
- env :
42
- GH_TOKEN : ${{ secrets[needs.automation.outputs.token-secret-name] }}
43
-
44
42
steps :
43
+ - uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
44
+ id : otelbot-token
45
+ with :
46
+ app-id : ${{ vars.OTELBOT_DOTNET_APP_ID }}
47
+ private-key : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
48
+
45
49
- name : Check out code
46
50
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47
51
with :
48
- token : ${{ env.GH_TOKEN }}
52
+ token : ${{ steps.otelbot-token.outputs.token }}
49
53
50
54
- name : Create GitHub Pull Request to prepare release
51
55
shell : pwsh
52
56
env :
57
+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
53
58
BOT_USER_EMAIL : ${{ needs.automation.outputs.email }}
54
59
BOT_USER_NAME : ${{ needs.automation.outputs.username }}
55
60
COMMENT_USER_NAME : ${{ github.event.sender.login }}
@@ -75,32 +80,36 @@ jobs:
75
80
if : |
76
81
github.event_name == 'pull_request' &&
77
82
github.event.action == 'closed' &&
78
- github.event.pull_request.user.login == needs.automation.outputs.username &&
83
+ github.event.pull_request.user.login == needs.automation.outputs.application- username &&
79
84
github.event.pull_request.merged == true &&
80
85
startsWith(github.event.pull_request.title, '[release] Prepare release ') &&
81
86
needs.automation.outputs.enabled
82
87
83
- env :
84
- GH_TOKEN : ${{ secrets[needs.automation.outputs.token-secret-name] }}
85
-
86
88
steps :
89
+ - uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
90
+ id : otelbot-token
91
+ with :
92
+ app-id : ${{ vars.OTELBOT_DOTNET_APP_ID }}
93
+ private-key : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
94
+
87
95
- name : Check out code
88
96
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
89
97
with :
90
- token : ${{ env.GH_TOKEN }}
98
+ token : ${{ steps.otelbot-token.outputs.token }}
91
99
92
100
- name : Lock GitHub Pull Request to prepare release
93
101
shell : pwsh
94
102
env :
95
- BOT_USER_NAME : ${{ needs.automation.outputs.username }}
103
+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
104
+ EXPECTED_PR_AUTHOR_USER_NAME : ${{ needs.automation.outputs.application-name }}
96
105
ISSUE_NUMBER : ${{ github.event.pull_request.number }}
97
106
run : |
98
107
Import-Module .\build\scripts\prepare-release.psm1
99
108
100
109
LockPullRequestAndPostNoticeToCreateReleaseTag `
101
110
-gitRepository ${env:GITHUB_REPOSITORY} `
102
111
-pullRequestNumber ${env:ISSUE_NUMBER} `
103
- -botUserName ${env:BOT_USER_NAME }
112
+ -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME }
104
113
105
114
create-release-tag-pr-post-notice :
106
115
runs-on : ubuntu-22.04
@@ -111,37 +120,42 @@ jobs:
111
120
github.event_name == 'issue_comment' &&
112
121
github.event.issue.pull_request &&
113
122
github.event.issue.locked == true &&
114
- github.event.comment.user.login != needs.automation.outputs.username &&
123
+ github.event.comment.user.login != needs.automation.outputs.application- username &&
115
124
contains(github.event.comment.body, '/CreateReleaseTag') &&
116
125
startsWith(github.event.issue.title, '[release] Prepare release ') &&
117
126
github.event.issue.pull_request.merged_at &&
118
127
needs.automation.outputs.enabled
119
128
120
- env :
121
- GH_TOKEN : ${{ secrets[needs.automation.outputs.token-secret-name] }}
122
-
123
129
steps :
130
+ - uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
131
+ id : otelbot-token
132
+ with :
133
+ app-id : ${{ vars.OTELBOT_DOTNET_APP_ID }}
134
+ private-key : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
135
+
124
136
- name : Check out code
125
137
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
126
138
with :
127
139
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
128
140
fetch-depth : 0
129
- token : ${{ env.GH_TOKEN }}
141
+ token : ${{ steps.otelbot-token.outputs.token }}
130
142
131
143
- name : Create release tag
132
144
id : create-tag
133
145
shell : pwsh
134
146
env :
147
+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
135
148
BOT_USER_EMAIL : ${{ needs.automation.outputs.email }}
136
149
BOT_USER_NAME : ${{ needs.automation.outputs.username }}
150
+ EXPECTED_PR_AUTHOR_USER_NAME : ${{ needs.automation.outputs.application-name }}
137
151
ISSUE_NUMBER : ${{ github.event.issue.number }}
138
152
run : |
139
153
Import-Module .\build\scripts\prepare-release.psm1
140
154
141
155
CreateReleaseTagAndPostNoticeOnPullRequest `
142
156
-gitRepository ${env:GITHUB_REPOSITORY} `
143
157
-pullRequestNumber ${env:ISSUE_NUMBER} `
144
- -botUserName ${env:BOT_USER_NAME } `
158
+ -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME } `
145
159
-gitUserName ${env:BOT_USER_NAME} `
146
160
-gitUserEmail ${env:BOT_USER_EMAIL}
147
161
@@ -154,28 +168,33 @@ jobs:
154
168
github.event_name == 'issue_comment' &&
155
169
github.event.issue.pull_request &&
156
170
github.event.issue.state == 'open' &&
157
- github.event.comment.user.login != needs.automation.outputs.username &&
171
+ github.event.comment.user.login != needs.automation.outputs.application- username &&
158
172
contains(github.event.comment.body, '/UpdateReleaseDates') &&
159
173
startsWith(github.event.issue.title, '[release] Prepare release ') &&
160
174
github.event.issue.pull_request.merged_at == null &&
161
175
needs.automation.outputs.enabled
162
176
163
- env :
164
- GH_TOKEN : ${{ secrets[needs.automation.outputs.token-secret-name] }}
165
-
166
177
steps :
178
+ - uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
179
+ id : otelbot-token
180
+ with :
181
+ app-id : ${{ vars.OTELBOT_DOTNET_APP_ID }}
182
+ private-key : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
183
+
167
184
- name : Check out code
168
185
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
169
186
with :
170
187
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
171
188
fetch-depth : 0
172
- token : ${{ env.GH_TOKEN }}
189
+ token : ${{ steps.otelbot-token.outputs.token }}
173
190
174
191
- name : Update release date
175
192
shell : pwsh
176
193
env :
194
+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
177
195
BOT_USER_EMAIL : ${{ needs.automation.outputs.email }}
178
196
BOT_USER_NAME : ${{ needs.automation.outputs.username }}
197
+ EXPECTED_PR_AUTHOR_USER_NAME : ${{ needs.automation.outputs.application-name }}
179
198
COMMENT_USER_NAME : ${{ github.event.comment.user.login }}
180
199
ISSUE_NUMBER : ${{ github.event.issue.number }}
181
200
run : |
@@ -184,7 +203,7 @@ jobs:
184
203
UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest `
185
204
-gitRepository ${env:GITHUB_REPOSITORY} `
186
205
-pullRequestNumber ${env:ISSUE_NUMBER} `
187
- -botUserName ${env:BOT_USER_NAME } `
206
+ -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME } `
188
207
-commentUserName ${env:COMMENT_USER_NAME} `
189
208
-gitUserName ${env:BOT_USER_NAME} `
190
209
-gitUserEmail ${env:BOT_USER_EMAIL}
@@ -198,27 +217,32 @@ jobs:
198
217
github.event_name == 'issue_comment' &&
199
218
github.event.issue.pull_request &&
200
219
github.event.issue.state == 'open' &&
201
- github.event.comment.user.login != needs.automation.outputs.username &&
220
+ github.event.comment.user.login != needs.automation.outputs.application- username &&
202
221
contains(github.event.comment.body, '/UpdateReleaseNotes') &&
203
222
startsWith(github.event.issue.title, '[release] Prepare release ') &&
204
223
github.event.issue.pull_request.merged_at == null &&
205
224
needs.automation.outputs.enabled
206
225
207
- env :
208
- GH_TOKEN : ${{ secrets[needs.automation.outputs.token-secret-name] }}
209
-
210
226
steps :
227
+ - uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
228
+ id : otelbot-token
229
+ with :
230
+ app-id : ${{ vars.OTELBOT_DOTNET_APP_ID }}
231
+ private-key : ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }}
232
+
211
233
- name : Check out code
212
234
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
213
235
with :
214
236
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
215
237
fetch-depth : 0
216
- token : ${{ env.GH_TOKEN }}
238
+ token : ${{ steps.otelbot-token.outputs.token }}
217
239
218
240
- name : Update release notes
219
241
env :
242
+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
220
243
BOT_USER_EMAIL : ${{ needs.automation.outputs.email }}
221
244
BOT_USER_NAME : ${{ needs.automation.outputs.username }}
245
+ EXPECTED_PR_AUTHOR_USER_NAME : ${{ needs.automation.outputs.application-name }}
222
246
COMMENT_BODY : ${{ github.event.comment.body }}
223
247
COMMENT_USER_NAME : ${{ github.event.comment.user.login }}
224
248
ISSUE_NUMBER : ${{ github.event.issue.number }}
@@ -229,7 +253,7 @@ jobs:
229
253
UpdateReleaseNotesAndPostNoticeOnPullRequest `
230
254
-gitRepository ${env:GITHUB_REPOSITORY} `
231
255
-pullRequestNumber ${env:ISSUE_NUMBER} `
232
- -botUserName ${env:BOT_USER_NAME } `
256
+ -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME } `
233
257
-commentUserName ${env:COMMENT_USER_NAME} `
234
258
-commentBody $Env:COMMENT_BODY `
235
259
-gitUserName ${env:BOT_USER_NAME} `
0 commit comments