Improve workflow logic checks for private repos - #12939
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
aaronjorbin
left a comment
There was a problem hiding this comment.
-
Is there a reason that this logic shouldn't also apply to draft PRs in this repo? It's something that could reduce the number of jobs which get spawned.
-
I assume this is something that is backported down to 4.7, agree?
The main motivation behind this PR was to reduce unexpectedly high usage in private repositories while creating pull requests as these have a monetary cost associated with them and can lead to high bills. Public workflow minutes are free, so I had not yet considered this. The conditions are currently configured to say "everything always runs on It's possible to expand this to this public repo and public forks, I think something like this would work: However, a side effect of also targeting this repository is that contributors who are not org members would be unable to add the override label to a pull request since they lack the needed privileges. Instead, they would forced to mark a pull request "Ready for Review" to receive automated feedback on their work (even if the PR is not actually ready for a review from other contributors). The maximum concurrent job limit for the WordPress GitHub organization was also just doubled from
There were a number of tooling improvements during the 7.1 cycle that I think should be backported to all branches eligible to receive security updates. I agree that this should be added to the list. |
That's a good point and makes a lot of sense to me. I think that overrides the benefits of reducing the number of jobs. |
aaronjorbin
left a comment
There was a problem hiding this comment.
Confirmed that these are all the relevant workflows by grepping for "github.repository == 'WordPress/wordpress-develop'" in the workflows directory and checking each one that's not listed him. Each code block also looks generally correct to me.
This expands the conditional checks attached to GitHub Actions workflow jobs to further limit when
pull_requestevents spawn workflow runs within forks and private mirrors.When the repository is not
WordPress/wordpress-develop, the workflow now must be triggered by a pull request that is marked ready for review for all private repositories.In case someone wishes to run workflows in a draft PR, the
Draft Workflow Runslabel could be added to the pull request and all future workflows will run.Trac ticket: Core-64893.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Used for creating the initial PR. All changes were manually reviewed by me.
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.