Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/example stanza for forked non forked usecase #1231

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading