Skip to content

ci: add fork PR support to /rebase workflow#3174

Open
waveywaves wants to merge 1 commit intotektoncd:mainfrom
waveywaves:ci/rebase-fork-support
Open

ci: add fork PR support to /rebase workflow#3174
waveywaves wants to merge 1 commit intotektoncd:mainfrom
waveywaves:ci/rebase-fork-support

Conversation

@waveywaves
Copy link
Member

Changes

Replace the hard fork rejection ("Cannot rebase PRs from forks") with fork detection and maintainerCanModify validation. Fork PRs are now rebased by checking out the fork repo, adding upstream as a remote for the base branch, performing the rebase, and pushing back to the fork with --force-with-lease.

This mirrors the fork support already implemented in the /squash workflow (_squash-command.yaml from PR #3173), using the same pattern:

  • Checkout the fork repo directly (origin = fork)
  • Add upstream remote for the base branch
  • Rebase onto upstream/<base> instead of origin/<base>
  • Push to origin (which is the fork)

Fork PRs require the author to enable "Allow edits from maintainers" in the PR settings. If disabled, the workflow posts an actionable error message asking the author to enable it. Same-repo PR behavior is completely unchanged.

Motivation: All fork-based contributions (e.g., PRs #9366, #9367, #9368 on tektoncd/pipeline) currently cannot use /rebase, forcing manual rebases. This is especially painful when multiple PRs need rebasing after dependency bumps land on main.

/kind feature

Submitter Checklist

See the contribution guide for more details.

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 25, 2026
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign anithapriyanatarajan after the PR has been reviewed.
You can assign the PR to them by writing /assign @anithapriyanatarajan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2026
@waveywaves waveywaves force-pushed the ci/rebase-fork-support branch from c519c13 to 97fa0fe Compare February 25, 2026 07:30
Replace the hard fork rejection ("Cannot rebase PRs from forks") with
fork detection and maintainerCanModify validation. Fork PRs are now
rebased by checking out the fork repo, adding upstream as a remote for
the base branch, performing the rebase, and pushing back to the fork
with --force-with-lease.

This mirrors the fork support already implemented in the /squash
workflow (_squash-command.yaml), using the same pattern:
- Checkout the fork repo directly (origin = fork)
- Add upstream remote for the base branch
- Rebase onto upstream/<base> instead of origin/<base>
- Push to origin (which is the fork)

Fork PRs require the author to enable "Allow edits from maintainers"
in the PR settings. If disabled, the workflow posts an actionable error
message. Same-repo PR behavior is completely unchanged.
@waveywaves waveywaves force-pushed the ci/rebase-fork-support branch from 97fa0fe to e7ea7c7 Compare February 25, 2026 07:43
@waveywaves
Copy link
Member Author

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

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants