File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,40 @@ This will securely post the check results from the privileged workflow onto the
244
244
</p>
245
245
</details>
246
246
247
+ In environments that do not allow `checks : write`, the action can be configured to leverage the annotate\_only option.
248
+
249
+ <details><summary><b>Example</b></summary>
250
+ <p>
251
+
252
+ ` ` ` yml
253
+ name: pr
254
+
255
+ on:
256
+ pull_request:
257
+
258
+ jobs:
259
+ unit_test:
260
+ runs-on: ubuntu-latest
261
+ steps:
262
+ - name: Checkout Code
263
+ uses: actions/checkout@v4
264
+
265
+ - name: Build and Run Tests
266
+ run: # execute your tests generating test results
267
+
268
+ - name: Write out Unit Test report annotation for forked repo
269
+ if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }}
270
+ uses: mikepenz/action-junit-report@v5
271
+ with:
272
+ annotate_only: true # forked repo cannot write to checks so just do annotations
273
+ ` ` `
274
+
275
+ This will selectively use different methods for forked and unforked repos.
276
+ </p>
277
+ </details>
278
+
279
+
280
+
247
281
# # Sample 🖥️
248
282
249
283
<div align="center">
You can’t perform that action at this time.
0 commit comments