Prevent Dependabot workflows for private mirrors #8576
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the
if
conditionals for workflows use one of two approaches to limit when they run: Run if the repository isWordPress/wordpress-develop
OR if the workflow is triggered by apull_request
event. This prevents workflows from running needlessly on forks and mirrors when branches are synced or updated through push events, but still allows contributors to open PRs back to their forks to test changes before submitting them back.This can cause some issues with Dependabot, though. Dependabot is disabled by default for all forks. However, it is impossible to disable Dependabot for mirrors when a
dependabot.yml
file is present. This is especially problematic for private mirrors, which consume resources for organizations.This switches the OR condition to run workflows if triggered by a
pull_request
AND the actor is not dependabot to prevent these workflows from running in this situation.Trac ticket: https://core.trac.wordpress.org/ticket/62221
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.