From a7b788ae2a0215cf58b4275d8c109a487ed946c1 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Mon, 14 Mar 2022 10:38:22 +0100 Subject: [PATCH] publish.yml: Limit the running scope of the publish Workflow. 1. Don't run the publish test result workflow on the master branch. 2. Run only on Pull Requests to be able to publish the result as a PR comment. 3. Avoid running when the triggering workflow was skipped, this will cause a failure as no file will be uploaded. Signed-off-by: Abdelatif Guettouche --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5d2027ff7e3..e593d80dd50 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,7 @@ name: Unit Test Results on: workflow_run: workflows: [Run tests in hardware] + branches-ignore: [master] types: - completed @@ -11,6 +12,9 @@ jobs: unit-test-results: name: Unit Test Results runs-on: ubuntu-latest + if: | + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion != 'skipped' steps: - name: Download and Extract Artifacts env: