-
Notifications
You must be signed in to change notification settings - Fork 50
Prevent dependabot PRs from running a docs preview #747
Conversation
API Developer Docs Preview: Ready https://wordpress.github.io/openverse-api/_preview/747 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
This looks like it will the docs preview from running on PRs from forks, but I'm not sure it will work for dependabot 🤔 The docs seem to indicate that dependabot PRs are treated as though they came from a fork, but they aren't actually:
Maybe something like this would work? |
Where is this coming from? I added the explicit exclusion for depentabot to be extra sure anyway. Thanks for the handy reference! |
d05d953
to
2d7bd70
Compare
.github/workflows/ci_cd.yml
Outdated
@@ -255,7 +255,8 @@ jobs: | |||
publish-docs: | |||
name: Publish developer docs | |||
runs-on: ubuntu-latest | |||
if: github.event_name == 'push' && github.repository == 'WordPress/openverse-api' | |||
# Check if the event is not triggered by a fork or dependabot | |||
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != "dependabot[bot]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm worried that this won't run if the PR is pushed to (since it's referencing event.pull_request
vs event_name == 'push'
. Do you know if there might be a way to test it? We may just want to add github.actor != "dependabot[bot]"
to the end of the existing conditional.
Sorry, this is coming from the github.blog announcement linked in the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes
Fixes #746 by @AetherUnbound
Description
This should prevent the job to run on dependabot's PRs according to: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks
Testing Instructions
Merge and rebase an ask dependabot to rebase one PR to see if it works.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin