Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Prevent running certain workflows on forks (#3773)

Madison Swain-Bowdene98f7e90f260
diff --git a/.github/workflows/generate_pot.yml b/.github/workflows/generate_pot.yml
index 0d7b7e3c2..b1af0babe 100644
--- a/.github/workflows/generate_pot.yml
+++ b/.github/workflows/generate_pot.yml
@@ -16,6 +16,8 @@ jobs:
generate-pot:
name: Generate POT file
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.github/workflows/issue_automations.yml b/.github/workflows/issue_automations.yml
index fd6fefbfc..3e0a66781 100644
--- a/.github/workflows/issue_automations.yml
+++ b/.github/workflows/issue_automations.yml
@@ -18,6 +18,8 @@ jobs:
run:
name: Perform issue automations
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.github/workflows/label_sync.yml b/.github/workflows/label_sync.yml
index d4d3710fa..fae7b7620 100644
--- a/.github/workflows/label_sync.yml
+++ b/.github/workflows/label_sync.yml
@@ -10,6 +10,8 @@ jobs:
sync_labels:
name: Sync labels
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.github/workflows/pr_automations.yml b/.github/workflows/pr_automations.yml
index bfc8c0e6c..4e67624fa 100644
--- a/.github/workflows/pr_automations.yml
+++ b/.github/workflows/pr_automations.yml
@@ -33,6 +33,8 @@ jobs:
run:
name: Perform PR automations
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.github/workflows/pr_automations_init.yml b/.github/workflows/pr_automations_init.yml
index acae02e92..e54540b56 100644
--- a/.github/workflows/pr_automations_init.yml
+++ b/.github/workflows/pr_automations_init.yml
@@ -34,6 +34,8 @@ jobs:
run:
name: Save event info
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Save event info
run: |
diff --git a/.github/workflows/pr_ping.yml b/.github/workflows/pr_ping.yml
index 9bc827f86..b48eecfc5 100644
--- a/.github/workflows/pr_ping.yml
+++ b/.github/workflows/pr_ping.yml
@@ -10,9 +10,12 @@ on:
jobs:
send_message:
name: Send Slack message
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ # Also prevent running this for bot-related PRs
if: |
github.actor != 'dependabot[bot]' &&
- !startsWith(github.event.pull_request.title, '🔄')
+ !startsWith(github.event.pull_request.title, '🔄') &&
+ github.repository_owner == 'WordPress'
runs-on: ubuntu-latest
env:
pr_url: ${{ github.event.pull_request.html_url }}
diff --git a/.github/workflows/project_thread_update_reminders.yml b/.github/workflows/project_thread_update_reminders.yml
index 9d3c8319b..293d780bd 100644
--- a/.github/workflows/project_thread_update_reminders.yml
+++ b/.github/workflows/project_thread_update_reminders.yml
@@ -8,6 +8,8 @@ on:
jobs:
send-reminders:
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v6
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 762b5955f..eea0a3fbd 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -23,6 +23,8 @@ jobs:
release-app:
name: Release app
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
permissions:
# Needed to create the GitHub release on the repo
contents: write
diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml
index d10eeda76..88b06b2d1 100644
--- a/.github/workflows/renovate.yml
+++ b/.github/workflows/renovate.yml
@@ -28,7 +28,8 @@ env:
jobs:
renovate:
runs-on: ubuntu-latest
- if: github.repository == 'WordPress/openverse'
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/subscribe_to_label.yml b/.github/workflows/subscribe_to_label.yml
index 06c5de46e..a2b9b0aca 100644
--- a/.github/workflows/subscribe_to_label.yml
+++ b/.github/workflows/subscribe_to_label.yml
@@ -8,6 +8,8 @@ on:
jobs:
subscribe:
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- uses: bytecodealliance/subscribe-to-label-action@v1
with:
diff --git a/.github/workflows/sync_meta.yml b/.github/workflows/sync_meta.yml
index 5ca5d35fb..06d54caa3 100644
--- a/.github/workflows/sync_meta.yml
+++ b/.github/workflows/sync_meta.yml
@@ -16,6 +16,8 @@ jobs:
sync_meta:
name: Sync meta files
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.github/workflows/weekly_updates.yml b/.github/workflows/weekly_updates.yml
index b39018d7c..6c52d0aee 100644
--- a/.github/workflows/weekly_updates.yml
+++ b/.github/workflows/weekly_updates.yml
@@ -15,6 +15,8 @@ jobs:
make_post:
name: Create post on Make site
runs-on: ubuntu-latest
+ # Prevent running this workflow on forks, it's unnecessary for external contributors
+ if: github.repository_owner == 'WordPress'
steps:
- name: Checkout repository
uses: actions/checkout@v4