Skip to content

Commit

Permalink
Prevent running certain workflows on forks (#3773)
Browse files Browse the repository at this point in the history
* Prevent running certain workflows on forks

* Add a comment for the expression
  • Loading branch information
AetherUnbound authored Feb 9, 2024
1 parent f8e6d35 commit e98f7e9
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/generate_pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/issue_automations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/label_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_automations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_automations_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr_ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/project_thread_update_reminders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/subscribe_to_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sync_meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/weekly_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e98f7e9

Please sign in to comment.