Skip to content

ci: only accept PRs into main from rc-* branches - #40

Open
prabod wants to merge 2 commits into
mainfrom
chore/main-pr-source-guard
Open

prabod wants to merge 2 commits into
mainfrom
chore/main-pr-source-guard

Conversation

@prabod

@prabod prabod commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Part of the new main guard (rulesets main: pull requests only and main: only main-maintainers merge are already active).

Adds a rc branch only check that fails unless a PR into main comes from an rc-* branch of this repo (forks rejected). It runs on pull_request_target, so it uses main's copy of the workflow and a PR can't edit its own check. It never checks out PR code and has permissions: {}.

Bootstrap note: this PR is the one exception to rc-only. pull_request_target only runs workflows that are already on main, so the check can't exist until this merges. After merge, rc branch only gets added as a required check in the ruleset.

Effect: hotfixes like #34 / #37 (fix/* → main) now have to go through the current rc branch.

Adds a 'rc branch only' check that fails unless the PR's head is an rc-*
branch of this repository. It runs via pull_request_target so the PR under
review cannot alter it, and never checks out PR code.
@prabod
prabod force-pushed the chore/main-pr-source-guard branch from 4f037ec to 8591ddd Compare October 26, 2026 12:42
A dependabot/* branch passes only when the PR's author is dependabot[bot];
the branch name alone could be pushed by anyone with write access.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant