Repository navigation
Github action to automatically create backport PR from merged PR's changes using labels - #1148
Merged
Merged
Conversation
Signed-off-by: Tathagata Das <[email protected]>
Added custom token and updated label pattern for backporting. Signed-off-by: Tathagata Das <[email protected]>
openinx
approved these changes
Oct 31, 2025
openinx
left a comment
Collaborator
There was a problem hiding this comment.
Two minor comments, otherwise looks good to me !
| with: | ||
| # Use custom token for backport operations | ||
| github_token: ${{ secrets.BACKPORT_ACTION_TOKEN }} | ||
|
|
Collaborator
| runs-on: ubuntu-latest | ||
| name: Backport PR | ||
| # Only run if the PR was merged (not just closed) | ||
| if: github.event.pull_request.merged == true |
Collaborator
There was a problem hiding this comment.
Do we need to limit this application to main branch only to prevent triggering on already backported branches ?
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true
Contributor
Author
There was a problem hiding this comment.
we are going to manually add labels. so its not fine if we choose backport a backport PR. for example
- main PR --> apply label: "backport branch-0.3" --> merge
- 0.3 PR from merged changes in main PR --> conflict --> resolved conflict --> apply label: "backport branch-0.2" --> merge
- This is useful because now we know that after conflict resolution this diff may work for 0.2 as well, so backport this to 0.2
- 0.2 PR from merged changes in 0.3 PR
wdyt?
Collaborator
There was a problem hiding this comment.
Sounds good to me, thanks @tdas for the work !
1 of 4 tasks
Signed-off-by: Tathagata Das <[email protected]>
tdas
enabled auto-merge (squash)
October 31, 2025 20:28
tdas
disabled auto-merge
November 1, 2025 00:19
1 of 4 tasks
tdas
added a commit
that referenced
this pull request
Nov 5, 2025
**PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Follow up of - #1148 It created this backport PR - #1150 But the problem is that the commit in the backported PR dont have the signoff. So even if there are no conflicts, the PR cannot be readily merged. So I modified the backport GitHub action to automatically amend backport commits with sign-off. The workflow now: - Extracts the original commit author's name and email from each backport branch - Amends the commit with `--signoff` flag using the original author's credentials - Force pushes the updated branch This ensures all backported commits include proper sign-off from the original author. Signed-off-by: Tathagata Das <[email protected]>
13 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

PR Checklist
docsis updatedDescription of changes
As the title says. Specifically,
It uses this market place action - https://github.com/marketplace/actions/backport-merged-pull-requests-to-selected-branches#backport-action
Here is an example usage in a project that i coped - https://github.com/camunda/camunda/blob/main/.github/workflows/backport.yml