Skip to content

Commit

Permalink
Merge pull request #1231 from gilesw/docs/example-stanza-for-forked-n…
Browse files Browse the repository at this point in the history
…on-forked-usecase

Docs/example stanza for forked non forked usecase
  • Loading branch information
mikepenz authored Nov 16, 2024
2 parents 511b061 + eb88208 commit 6141c38
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,40 @@ This will securely post the check results from the privileged workflow onto the
</p>
</details>

In environments that do not allow `checks: write`, the action can be configured to leverage the annotate\_only option.

<details><summary><b>Example</b></summary>
<p>

```yml
name: pr
on:
pull_request:
jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build and Run Tests
run: # execute your tests generating test results
- name: Write out Unit Test report annotation for forked repo
if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }}
uses: mikepenz/action-junit-report@v5
with:
annotate_only: true # forked repo cannot write to checks so just do annotations
```

This will selectively use different methods for forked and unforked repos.
</p>
</details>



## Sample 🖥️

<div align="center">
Expand Down

0 comments on commit 6141c38

Please sign in to comment.