From 0c22ef3fa3a004a69cd2a15478e081d9f94665ee Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 20 Sep 2025 10:31:03 +0200 Subject: [PATCH 1/2] Run scheduled CI jobs only on upstream repo --- .github/workflows/cron-ci.yaml | 8 ++++++++ .github/workflows/release.yml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index 6389fee1cb..e2e2ed1880 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -18,6 +18,8 @@ jobs: codecov: name: Collect code coverage data runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -44,6 +46,8 @@ jobs: testdata: name: Collect regression test data runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -73,6 +77,8 @@ jobs: whatsleft: name: Collect what is left data runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -111,6 +117,8 @@ jobs: benchmark: name: Collect benchmark data runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6a1ad3209..1969322ff2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,8 @@ env: jobs: build: runs-on: ${{ matrix.platform.runner }} + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' strategy: matrix: platform: @@ -88,6 +90,8 @@ jobs: build-wasm: runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -136,6 +140,8 @@ jobs: release: runs-on: ubuntu-latest + # Disable this job when running on a fork. + if: github.repository == 'RustPython/RustPython' needs: [build, build-wasm] steps: - name: Download Binary Artifacts From 40d0749639c511bb83547b07d5462825630ecd3c Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 20 Sep 2025 17:29:28 +0200 Subject: [PATCH 2/2] Only disable if scheduling on forks --- .github/workflows/cron-ci.yaml | 16 ++++++++-------- .github/workflows/release.yml | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index e2e2ed1880..868675ca1c 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -18,8 +18,8 @@ jobs: codecov: name: Collect code coverage data runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -46,8 +46,8 @@ jobs: testdata: name: Collect regression test data runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -77,8 +77,8 @@ jobs: whatsleft: name: Collect what is left data runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -117,8 +117,8 @@ jobs: benchmark: name: Collect benchmark data runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f5c7ed9d1..5d78a66339 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,8 @@ env: jobs: build: runs-on: ${{ matrix.platform.runner }} - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} strategy: matrix: platform: @@ -90,8 +90,8 @@ jobs: build-wasm: runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -140,8 +140,8 @@ jobs: release: runs-on: ubuntu-latest - # Disable this job when running on a fork. - if: github.repository == 'RustPython/RustPython' + # Disable this scheduled job when running on a fork. + if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }} needs: [build, build-wasm] steps: - name: Download Binary Artifacts