From 89339df264ab09320e31f6edd9a6d355a09244fb Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Fri, 20 Mar 2020 18:28:47 +0100 Subject: [PATCH] ci: run the "bors build finished" jobs only during try and auto runs --- .github/workflows/ci.yml | 8 ++++---- src/ci/github-actions/ci.yml | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fea45a4c913d..d1261f04b8255 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -746,7 +746,7 @@ jobs: try-success: needs: - try - if: success() + if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'" steps: - name: mark the job as a success run: exit 0 @@ -755,7 +755,7 @@ jobs: try-failure: needs: - try - if: "!success()" + if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'" steps: - name: mark the job as a failure run: exit 1 @@ -764,7 +764,7 @@ jobs: auto-success: needs: - auto - if: success() + if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'" steps: - name: mark the job as a success run: exit 0 @@ -773,7 +773,7 @@ jobs: auto-failure: needs: - auto - if: "!success()" + if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'" steps: - name: mark the job as a failure run: exit 1 diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index b4f2a367f4de2..81a334cd487c6 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -221,14 +221,12 @@ x--expand-yaml-anchors--remove: runs-on: ubuntu-latest - &base-success-job - if: success() steps: - name: mark the job as a success run: exit 0 <<: *base-outcome-job - &base-failure-job - if: "!success()" steps: - name: mark the job as a failure run: exit 1 @@ -695,13 +693,17 @@ jobs: # successful listening to webhooks only. try-success: needs: [try] + if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'" <<: *base-success-job try-failure: needs: [try] + if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'" <<: *base-failure-job auto-success: needs: [auto] + if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'" <<: *base-success-job auto-failure: needs: [auto] + if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'" <<: *base-failure-job