@@ -26,7 +26,7 @@ or  self-hosted runners that support Docker:
2626``` yaml
2727- name : Publish Test Results
2828 uses : EnricoMi/publish-unit-test-result-action@v2
29- if : always( )
29+ if : (!cancelled() )
3030 with :
3131 files : |
3232 test-results/**/*.xml
@@ -40,7 +40,7 @@ Use this for  (e.g. `runs-on: macos-latest`) runne
4040` ` ` yaml
4141- name: Publish Test Results
4242 uses: EnricoMi/publish-unit-test-result-action/macos@v2
43- if: always( )
43+ if: (!cancelled() )
4444 with:
4545 files: …
4646` ` `
@@ -49,7 +49,7 @@ Use this for  (e.g. `runs-on: macos-latest`) runne
4949` ` ` yaml
5050- name: Publish Test Results
5151 uses: EnricoMi/publish-unit-test-result-action/windows@v2
52- if: always( )
52+ if: (!cancelled() )
5353 with:
5454 files: …
5555` ` `
@@ -58,7 +58,7 @@ For Windows **without PowerShell** installed, there is the Bash shell variant:
5858` ` ` yaml
5959- name: Publish Test Results
6060 uses: EnricoMi/publish-unit-test-result-action/windows/bash@v2
61- if: always( )
61+ if: (!cancelled() )
6262 with:
6363 files: …
6464` ` `
@@ -67,7 +67,7 @@ For **self-hosted** Linux GitHub Actions runners **without Docker** installed, p
6767` ` ` yaml
6868- name: Publish Test Results
6969 uses: EnricoMi/publish-unit-test-result-action/linux@v2
70- if: always( )
70+ if: (!cancelled() )
7171 with:
7272 files: …
7373` ` `
@@ -77,7 +77,8 @@ See the [notes on running this action as a non-Docker action](#running-as-a-non-
7777If you see the `"Resource not accessible by integration"` error, you have to grant additional [permissions](#permissions), or
7878[setup the support for pull requests from fork repositories and branches created by Dependabot](#support-fork-repositories-and-dependabot-branches).
7979
80- The `if : always()` clause guarantees that this action always runs, even if earlier steps (e.g., the test step) in your workflow fail.
80+ The `if : (!cancelled())` clause guarantees that this action always runs, even if earlier steps (e.g., the test step) in your workflow fail,
81+ but not if the workflow was cancelled.
8182
8283When run multiple times in one workflow, the [option](#configuration) `check_name` has to be set to a unique value for each instance.
8384Otherwise, the multiple runs overwrite each other's results.
@@ -368,7 +369,7 @@ The `json` output of the action can be accessed through the expression `steps.<i
368369- name: Publish Test Results
369370 uses: EnricoMi/publish-unit-test-result-action@v2
370371 id: test-results
371- if: always( )
372+ if: (!cancelled() )
372373 with:
373374 files: "test-results/**/*.xml"
374375
@@ -548,7 +549,7 @@ jobs:
548549 run: python -m pytest test --junit-xml pytest.xml
549550
550551 - name: Upload Test Results
551- if: always( )
552+ if: (!cancelled() )
552553 uses: actions/upload-artifact@v4
553554 with:
554555 name: Test Results (Python ${{ matrix.python-version }})
@@ -569,7 +570,7 @@ jobs:
569570
570571 # only needed for private repository
571572 issues: read
572- if: always( )
573+ if: (!cancelled() )
573574
574575 steps:
575576 - name: Download Artifacts
@@ -625,7 +626,7 @@ Adjust the value of `path` to fit your setup:
625626
626627` ` ` yaml
627628- name: Upload Test Results
628- if: always( )
629+ if: (!cancelled() )
629630 uses: actions/upload-artifact@v4
630631 with:
631632 name: Test Results
@@ -665,7 +666,7 @@ jobs:
665666 test-results:
666667 name: Test Results
667668 runs-on: ubuntu-latest
668- if: github.event.workflow_run.conclusion != 'skipped '
669+ if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure '
669670
670671 permissions:
671672 checks: write
@@ -724,7 +725,7 @@ Add the event name to `check_name` to avoid different event types overwriting ea
724725` ` ` yaml
725726- name: Publish Test Results
726727 uses: EnricoMi/publish-unit-test-result-action@v2
727- if: always( )
728+ if: (!cancelled() )
728729 with:
729730 check_name: "Test Results (${{ github.event.workflow_run.event || github.event_name }})"
730731 files: "test-results/**/*.xml"
@@ -737,7 +738,7 @@ Disabling the pull request comment mode (`"off"`) for events other than `pull_re
737738` ` ` yaml
738739- name: Publish Test Results
739740 uses: EnricoMi/publish-unit-test-result-action@v2
740- if: always( )
741+ if: (!cancelled() )
741742 with:
742743 # set comment_mode to "always" for pull_request event, set to "off" for all other event types
743744 comment_mode: ${{ (github.event.workflow_run.event == 'pull_request' || github.event_name == 'pull_request') && 'always' || 'off' }}
@@ -759,7 +760,7 @@ steps:
759760- name: Publish Test Results
760761 uses: EnricoMi/publish-unit-test-result-action@v2
761762 id: test-results
762- if: always( )
763+ if: (!cancelled() )
763764 with:
764765 files: "test-results/**/*.xml"
765766
@@ -820,14 +821,14 @@ you have to copy files to a relative path first, and then use the relative path:
820821
821822` ` ` yaml
822823- name: Copy Test Results
823- if: always( )
824+ if: (!cancelled() )
824825 run: |
825826 cp -Lpr /tmp/test-results test-results
826827 shell: bash
827828
828829- name: Publish Test Results
829830 uses: EnricoMi/publish-unit-test-result-action@v2
830- if: always( )
831+ if: (!cancelled() )
831832 with:
832833 files: |
833834 test-results/**/*.xml
0 commit comments