mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 10:55:23 -08:00
Fail the action if triggering workflow run has been cancelled
This commit is contained in:
@@ -54,8 +54,8 @@ jobs:
|
||||
|
||||
Workflows triggered by pull requests from forked repositories are executed with read-only token and therefore can't create check runs.
|
||||
To workaround this security restriction it's required to use two separate workflows:
|
||||
- `CI` runs in the context of PR head branch with read-only token. It executes the tests and uploads test results as build artifact
|
||||
- `Test Report` runs in the context of repository main branch with read/write token. It will download test results and create reports
|
||||
1. `CI` runs in the context of PR head branch with read-only token. It executes the tests and uploads test results as build artifact
|
||||
2. `Test Report` runs in the context of repository main branch with read/write token. It will download test results and create reports
|
||||
|
||||
**PR head branch:** *.github/workflows/ci.yml*
|
||||
```yaml
|
||||
@@ -70,6 +70,7 @@ jobs:
|
||||
- run: npm ci # install packages
|
||||
- run: npm test # run tests (configured to use jest-junit reporter)
|
||||
- uses: actions/upload-artifact@v2 # upload test results
|
||||
if: success() || failure() # run this step even if previous step failed
|
||||
with:
|
||||
name: test-results
|
||||
path: jest-junit.xml
|
||||
|
||||
Reference in New Issue
Block a user