From 9b9744f25fb510f4638d9ec9b41484fec2e0332a Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Mon, 14 Mar 2022 11:30:33 +0100 Subject: [PATCH] publish.yml: Limit the running scope of the publish Workflow. (#6428) 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 5d2027ff..e593d80d 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: