From 65ae51b6fcb9745185c1982d7ddbea156e2bd7f7 Mon Sep 17 00:00:00 2001 From: "emilyye@google.com" Date: Fri, 10 Jul 2020 11:52:59 -0700 Subject: [PATCH 1/2] Check for main apache repo before running GH actions --- .github/workflows/build_wheels.yml | 11 +++++++---- .github/workflows/cancel.yml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index befe95cb7feb..fc2a5250db81 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -38,6 +38,7 @@ jobs: build_source: runs-on: ubuntu-latest + if: github.repository_owner == 'apache' steps: - name: Checkout code uses: actions/checkout@v2 @@ -74,7 +75,7 @@ jobs: name: Prepare GCS needs: build_source runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.repository_owner == 'apache' && github.event_name != 'pull_request' steps: - name: Authenticate on GCP uses: GoogleCloudPlatform/github-actions/setup-gcloud@master @@ -88,6 +89,7 @@ jobs: name: Upload source to GCS bucket needs: prepare_gcs runs-on: ubuntu-latest + if: github.repository_owner == 'apache' steps: - name: Download compressed sources from artifacts uses: actions/download-artifact@v2 @@ -106,6 +108,7 @@ jobs: name: Build wheels on ${{ matrix.os }} needs: build_source runs-on: ${{ matrix.os }} + if: github.repository_owner == 'apache' strategy: matrix: os : [ubuntu-latest, macos-latest] @@ -138,7 +141,7 @@ jobs: name: Upload wheels to GCS bucket needs: build_wheels runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.repository_owner == 'apache' && github.event_name != 'pull_request' strategy: matrix: os : [ubuntu-latest, macos-latest] @@ -180,7 +183,7 @@ jobs: name: List files on Google Cloud Storage Bucket needs: upload_wheels_to_gcs runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.repository_owner == 'apache' && github.event_name != 'pull_request' steps: - name: Authenticate on GCP uses: GoogleCloudPlatform/github-actions/setup-gcloud@master @@ -197,7 +200,7 @@ jobs: - build_wheels runs-on: ubuntu-latest timeout-minutes: 60 - if: github.event_name == 'schedule' + if: github.repository_owner == 'apache' && github.event_name == 'schedule' steps: - name: Checkout code on master branch uses: actions/checkout@master diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml index 0361e05f591b..58a0cf9b6f27 100644 --- a/.github/workflows/cancel.yml +++ b/.github/workflows/cancel.yml @@ -21,6 +21,7 @@ jobs: cancel: name: 'Cancel Previous Runs' runs-on: ubuntu-latest + if: github.repository_owner == 'apache' timeout-minutes: 3 steps: - name: Get workflow id From a42eac6d0f64805b849e37dc5f42559353e68cba Mon Sep 17 00:00:00 2001 From: "emilyye@google.com" Date: Tue, 14 Jul 2020 10:24:38 -0700 Subject: [PATCH 2/2] only repo-restrict GCS actions --- .github/workflows/build_wheels.yml | 2 -- .github/workflows/cancel.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index fc2a5250db81..9e20b3ee57bf 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -38,7 +38,6 @@ jobs: build_source: runs-on: ubuntu-latest - if: github.repository_owner == 'apache' steps: - name: Checkout code uses: actions/checkout@v2 @@ -108,7 +107,6 @@ jobs: name: Build wheels on ${{ matrix.os }} needs: build_source runs-on: ${{ matrix.os }} - if: github.repository_owner == 'apache' strategy: matrix: os : [ubuntu-latest, macos-latest] diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml index 58a0cf9b6f27..0361e05f591b 100644 --- a/.github/workflows/cancel.yml +++ b/.github/workflows/cancel.yml @@ -21,7 +21,6 @@ jobs: cancel: name: 'Cancel Previous Runs' runs-on: ubuntu-latest - if: github.repository_owner == 'apache' timeout-minutes: 3 steps: - name: Get workflow id