@@ -109,12 +109,38 @@ runs:
109
109
with :
110
110
path : ${{ inputs.diff-storage }}
111
111
fetch-depth : 0
112
+ token : ${{ inputs.token }}
113
+
114
+ - name : Get token identity
115
+ id : identity
116
+
117
+ with :
118
+ query : |
119
+ query {
120
+ viewer {
121
+ databaseId
122
+ login
123
+ }
124
+ }
125
+ env :
126
+ GITHUB_TOKEN : ${{ inputs.token }}
127
+
128
+ - name : Configure git
129
+ run : |
130
+ name="${{ fromJSON(steps.identity.outputs.data).viewer.login }}"
131
+ email="${{ format('{0}+{1}@users.noreply.github.com', fromJSON(steps.identity.outputs.data).viewer.databaseId, fromJSON(steps.identity.outputs.data).viewer.login) }}"
132
+
133
+ cat >> "$GITHUB_ENV" << EOF
134
+ GIT_AUTHOR_NAME=$name
135
+ GIT_AUTHOR_EMAIL=$email
136
+ GIT_COMMITTER_NAME=$name
137
+ GIT_COMMITTER_EMAIL=$email
138
+ EOF
139
+ shell : bash
112
140
113
141
- name : Initialize storage branch
114
142
working-directory : ${{ inputs.diff-storage }}
115
143
run : |
116
- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
117
- git config --global user.name "github-actions[bot]"
118
144
# Switch to the branch if it already exists
119
145
git switch ${{ inputs.diff-storage }} || true
120
146
git pull origin ${{ inputs.diff-storage }} || true
@@ -204,8 +230,6 @@ runs:
204
230
- name : Commit badge
205
231
working-directory : ${{ inputs.diff-storage }}/data
206
232
run : |
207
- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
208
- git config --global user.name "github-actions[bot]"
209
233
git switch ${{ inputs.diff-storage }} || true
210
234
git pull origin ${{ inputs.diff-storage }}
211
235
git add "${{ env.diff_storage_branch }}/${{ inputs.storage-subdirectory }}/badge.svg"
@@ -295,6 +319,7 @@ runs:
295
319
if : contains(inputs.publish, 'true')
296
320
uses : marocchino/sticky-pull-request-comment@v2
297
321
with :
322
+ GITHUB_TOKEN : ${{ inputs.token }}
298
323
header : ${{ inputs.path }}
299
324
path : .coverage-output.final
300
325
@@ -312,8 +337,6 @@ runs:
312
337
contains(inputs.diff, 'true')
313
338
working-directory : ${{ inputs.diff-storage }}
314
339
run : |
315
- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
316
- git config --global user.name "github-actions[bot]"
317
340
git switch ${{ inputs.diff-storage }}
318
341
git pull origin ${{ inputs.diff-storage }}
319
342
filename=$(basename ${{ inputs.path }})
0 commit comments