From 6c49572ee4503077c1aaac18c0bb0ea9ee0aac10 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 10 Sep 2025 04:49:14 -0700 Subject: [PATCH] Make sure we don't run RN CI on forks (#53707) Summary: We had reports from the Community of the RN CI running on forks and causing high costs and bills for them This change should make sure that the most impactful jobs only runs on the React Native CI and not on forks. ## Changelog: [Internal] - Pull Request resolved: https://github.com/facebook/react-native/pull/53707 Test Plan: GHA Reviewed By: cortinico Differential Revision: D82107313 Pulled By: cipolleschi fbshipit-source-id: ff7f418344975e7bb8306a6356d774c26bea3db1 --- .github/workflows/create-release.yml | 1 + .github/workflows/publish-bumped-packages.yml | 1 + .github/workflows/publish-release.yml | 2 ++ .github/workflows/retry-workflow.yml | 1 + .github/workflows/test-all.yml | 5 +++++ .github/workflows/validate-dotslash-artifacts.yml | 1 + 6 files changed, 11 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ae5800f81ee..19608358a5e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -19,6 +19,7 @@ on: jobs: create_release: + if: github.repository == 'facebook/react-native' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/publish-bumped-packages.yml b/.github/workflows/publish-bumped-packages.yml index f47ddd9fc03..ea8bc40a122 100644 --- a/.github/workflows/publish-bumped-packages.yml +++ b/.github/workflows/publish-bumped-packages.yml @@ -9,6 +9,7 @@ on: jobs: publish_bumped_packages: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' env: GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }} steps: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8f356720f0b..efa432f4542 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -21,6 +21,7 @@ jobs: prepare_hermes_workspace: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' env: HERMES_WS_DIR: /tmp/hermes HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion @@ -98,6 +99,7 @@ jobs: flavor: ${{ matrix.flavor }} prebuild_apple_dependencies: + if: github.repository == 'facebook/react-native' uses: ./.github/workflows/prebuild-ios-dependencies.yml secrets: inherit diff --git a/.github/workflows/retry-workflow.yml b/.github/workflows/retry-workflow.yml index aef1766b361..d943d657d82 100644 --- a/.github/workflows/retry-workflow.yml +++ b/.github/workflows/retry-workflow.yml @@ -9,6 +9,7 @@ on: jobs: rerun: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' steps: - name: rerun ${{ inputs.run_id }} env: diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index e4f00621dee..f1f61cedece 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -11,6 +11,7 @@ on: jobs: set_release_type: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' outputs: RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }} env: @@ -34,6 +35,7 @@ jobs: prepare_hermes_workspace: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' env: HERMES_WS_DIR: /tmp/hermes HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion @@ -112,6 +114,7 @@ jobs: flavor: ${{ matrix.flavor }} prebuild_apple_dependencies: + if: github.repository == 'facebook/react-native' uses: ./.github/workflows/prebuild-ios-dependencies.yml secrets: inherit @@ -594,6 +597,7 @@ jobs: test_js: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' strategy: fail-fast: false matrix: @@ -608,6 +612,7 @@ jobs: lint: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/.github/workflows/validate-dotslash-artifacts.yml b/.github/workflows/validate-dotslash-artifacts.yml index 2b62d3b34c8..9463dacde97 100644 --- a/.github/workflows/validate-dotslash-artifacts.yml +++ b/.github/workflows/validate-dotslash-artifacts.yml @@ -27,6 +27,7 @@ on: jobs: validate-dotslash-artifacts: runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' steps: - name: Checkout repository uses: actions/checkout@v4