From 402cb44a525c3431a093a863315d05ce543324fc 2024-03-11 10:37:35
From: Ian Thomas <ianthomas23@gmail.com>
Date: 2024-03-11 10:37:35
Subject: [PATCH] Disable scheduled CI runs on forks

---

diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml
index fe0083a..7fcd1b2 100644
--- a/.github/workflows/downstream.yml
+++ b/.github/workflows/downstream.yml
@@ -14,6 +14,8 @@ permissions:
 jobs:
   test:
     runs-on: ${{ matrix.os }}
+    # Disable scheduled CI runs on forks
+    if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
     strategy:
       matrix:
         os: [ubuntu-latest]
diff --git a/.github/workflows/nightly-wheel-build.yml b/.github/workflows/nightly-wheel-build.yml
index b1e242c..64a41e3 100644
--- a/.github/workflows/nightly-wheel-build.yml
+++ b/.github/workflows/nightly-wheel-build.yml
@@ -9,8 +9,8 @@ jobs:
   upload_anaconda:
     name: Upload to Anaconda
     runs-on: ubuntu-latest
-    # The artifacts cannot be uploaded on PRs
-    if: github.event_name != 'pull_request'
+    # The artifacts cannot be uploaded on PRs, also disable scheduled CI runs on forks
+    if: github.event_name != 'pull_request' && (github.event_name != 'schedule' || github.repository_owner == 'ipython')
 
     steps:
       - uses: actions/checkout@v3
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 4d87bf4..90da899 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,6 +15,8 @@ on:
 jobs:
   test:
     runs-on: ${{ matrix.os }}
+    # Disable scheduled CI runs on forks
+    if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
     strategy:
       fail-fast: false
       matrix: