From 6f5d2777cc96920fcdc667f016f8e18ea4dd767f Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 25 Apr 2022 16:27:30 -0700 Subject: [PATCH] Do not run GitHub workflows on forks (#1107) --- .github/workflows/beta.yml | 3 +++ .github/workflows/gh-pages.yml | 3 ++- .github/workflows/main.yml | 11 +++++++---- .github/workflows/verify-web-demos.yml | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index f8146e3ef..dd0b4e0bc 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -20,6 +20,7 @@ jobs: # need to test. stable-tests-on-beta: runs-on: ${{ matrix.os }} + if: github.repository == 'flutter/samples' strategy: fail-fast: false matrix: @@ -38,6 +39,7 @@ jobs: # channel. android-build: runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' steps: - uses: actions/checkout@v2 - uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 @@ -52,6 +54,7 @@ jobs: # channel. ios-build: runs-on: macos-latest + if: github.repository == 'flutter/samples' steps: - uses: actions/checkout@v2 - uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 37cad1e58..40db35050 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -10,8 +10,9 @@ on: jobs: build-and-deploy: permissions: - contents: write + contents: write runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' steps: - name: Checkout diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd8496043..ce45a9347 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: branches: [ master ] workflow_dispatch: schedule: - - cron: '0 0 * * *' # Every day at midnight + - cron: "0 0 * * *" # Every day at midnight defaults: run: @@ -20,6 +20,7 @@ jobs: flutter-tests: name: Test Flutter ${{ matrix.flutter_version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} + if: github.repository == 'flutter/samples' strategy: fail-fast: false matrix: @@ -30,31 +31,33 @@ jobs: - uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 with: distribution: 'zulu' - java-version: "12.x" + java-version: '12.x' - uses: subosito/flutter-action@6a13bd08366a2aafe8605f064f9d5a42107e6f1f with: channel: ${{ matrix.flutter_version }} - run: ./tool/flutter_ci_script_${{ matrix.flutter_version }}.sh android-build: runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' steps: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 - uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 with: distribution: 'zulu' - java-version: "12.x" + java-version: '12.x' - uses: subosito/flutter-action@6a13bd08366a2aafe8605f064f9d5a42107e6f1f with: channel: stable - run: ./tool/android_ci_script.sh ios-build: runs-on: macos-latest + if: github.repository == 'flutter/samples' steps: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 - uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 with: distribution: 'zulu' - java-version: "12.x" + java-version: '12.x' - uses: subosito/flutter-action@6a13bd08366a2aafe8605f064f9d5a42107e6f1f with: channel: stable diff --git a/.github/workflows/verify-web-demos.yml b/.github/workflows/verify-web-demos.yml index be5975ddf..3ac43ad2b 100644 --- a/.github/workflows/verify-web-demos.yml +++ b/.github/workflows/verify-web-demos.yml @@ -7,6 +7,7 @@ on: [push, pull_request] jobs: verify-web-demos: runs-on: ubuntu-latest + if: github.repository == 'flutter/samples' steps: - name: Checkout uses: actions/checkout@v2