Skip to content

CI improvements for PRs that do not target main#22435

Closed
kfc35 wants to merge 5 commits intobevyengine:mainfrom
kfc35:22368_prs_not_targeting_main
Closed

CI improvements for PRs that do not target main#22435
kfc35 wants to merge 5 commits intobevyengine:mainfrom
kfc35:22368_prs_not_targeting_main

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Jan 8, 2026

Objective

Solution

  • Only do Example Run if the pull request targets the main branch. (Example Run is a requirement for Example Run - PR Comments, which is the job that reports the screenshots comparison results)
  • Creates a new GitHub action called PR Not Targeting Main - PR Comment where, if the last comment was not from GH actions, it will comment “This PR does not target the main branch. If this was a mistake, you can edit your pull request and set the base branch to main.” I copied this based off of Example Run - PR Comments and just edited/deleted where I thought necessary.

If you’d like for the new GH Action check for a label, there’s currently no label to distinguish between a PR targeting main vs otherwise. Please create one for me and I can add that check to the new GitHub action.

This is my first time playing around with GH Actions so an extra careful eye is appreciated :)

Testing

I did not test this… I think we have to test it out in the wild, no? Or is there some other way?

@kfc35 kfc35 added A-Build-System Related to build systems or continuous integration S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jan 8, 2026
@james7132 james7132 requested a review from mockersf January 8, 2026 21:35
@mockersf
Copy link
Member

mockersf commented Jan 8, 2026

the commenting workflow should look more like https://github.com/bevyengine/bevy/blob/main/.github/workflows/welcome.yml

  • no checkout
  • no check on the last comment as it's only on pr opened
  • no secret

kfc35 and others added 2 commits January 8, 2026 16:51
only comment when pr is opened

Co-authored-by: François Mockers <francois.mockers@vleue.com>
Comment on lines +6 to +11
on:
pull_request_target:
types:
- opened
branches-ignore:
- main

Check failure

Code scanning / zizmor

use of fundamentally insecure workflow trigger Error

use of fundamentally insecure workflow trigger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m assuming this is warning about the use of pull_request_target but as far as I can read for the past few moments, I’m supposed to use it here for commenting on the pull request… thoughts?

@kfc35 kfc35 requested a review from mockersf January 8, 2026 22:20
Comment on lines +6 to +11
on:
pull_request_target:
types:
- opened
branches-ignore:
- "main"

Check failure

Code scanning / zizmor

use of fundamentally insecure workflow trigger Error

use of fundamentally insecure workflow trigger
@kfc35 kfc35 added S-Adopt-Me The original PR author has no intent to complete this work. Pick me up! and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 14, 2026
@kfc35 kfc35 closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Build-System Related to build systems or continuous integration D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Adopt-Me The original PR author has no intent to complete this work. Pick me up!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

better support for PR not targeting main

2 participants