From 37623732c6e82c7157067c62df0d165846143088 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:50:42 +0100 Subject: [PATCH] build: avoid running workflow twice for pull requests with branch on main repo --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2e15da4b..ea0bf7ec5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ on: jobs: build: - if: ${{ github.repository == 'rclone/rclone' || github.event.inputs.manual == 'true' }} + if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} timeout-minutes: 60 strategy: fail-fast: false @@ -220,7 +220,7 @@ jobs: if: matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone' lint: - if: ${{ github.repository == 'rclone/rclone' || github.event.inputs.manual == 'true' }} + if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} timeout-minutes: 30 name: "lint" runs-on: ubuntu-latest @@ -249,7 +249,7 @@ jobs: run: govulncheck ./... android: - if: ${{ github.repository == 'rclone/rclone' || github.event.inputs.manual == 'true' }} + if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} timeout-minutes: 30 name: "android-all" runs-on: ubuntu-latest