Skip to content

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

Update action "if" conditionals: check if the PR head belongs to the upstream repo (#797)

Zack Krida0782257e741d
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index 5d5ded355..25d9b660e 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -291,7 +291,7 @@ jobs:
name: Publish preview of developer docs for the branch
runs-on: ubuntu-latest
# Check if the event is not triggered by a fork or dependabot
- if: github.event_name == 'pull_request' && github.repository_owner == 'WordPress' && github.actor != 'dependabot[bot]'
+ if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'WordPress' && github.actor != 'dependabot[bot]'
needs:
- build-images
diff --git a/.github/workflows/pr_closed.yml b/.github/workflows/pr_closed.yml
index c53f16a30..01c8a057b 100644
--- a/.github/workflows/pr_closed.yml
+++ b/.github/workflows/pr_closed.yml
@@ -10,8 +10,7 @@ jobs:
name: Clean API developer docs preview
runs-on: ubuntu-latest
# Check if the event is not triggered by a fork or dependabot
- if: github.event_name == 'pull_request' && github.repository_owner == 'WordPress' && github.actor != 'dependabot[bot]'
-
+ if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'WordPress' && github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v3
with: