Add workflow to backport PRs to another branch#12964
Merged
TobiGr merged 2 commits intoTeamNewPipe:devfrom Jan 9, 2026
Merged
Conversation
.github/workflows/backport-pr.yml
Outdated
Comment on lines
+49
to
+50
| add_labels: ${{ env.BACKPORT_PR_LABELS }} | ||
| target_branches: ${{ env.BACKPORT_TARGET }} No newline at end of file |
Member
There was a problem hiding this comment.
Suggested change
| add_labels: ${{ env.BACKPORT_PR_LABELS }} | |
| target_branches: ${{ env.BACKPORT_TARGET }} | |
| target_branches: ${{ env.BACKPORT_TARGET }} | |
| add_labels: backport | |
| copy_labels_pattern: '.*' | |
| label_pattern: '' |
I think we can do this instead of parsing all labels manually, as per https://github.com/marketplace/actions/backport-merged-pull-requests-to-selected-branches#copy_labels_pattern
Contributor
Author
There was a problem hiding this comment.
Thanks. That is what I was looking for. I should have read the docs more closely.
The workflow can be triggered by creating a comment on a closed PR: /backport <TARGET_BRANCH> The backport can only be triggered by people with write access to the repository.
aa030be to
71d4eb6
Compare
Contributor
Author
|
You can see that the changes work in TobiGr#39 |
absurdlylongusername
approved these changes
Jan 7, 2026
.github/workflows/backport-pr.yml
Outdated
| set -euo pipefail | ||
| body="${{ github.event.comment.body }}" | ||
|
|
||
| line=${body%%$'\n'*} |
Member
There was a problem hiding this comment.
Suggested change
| line=${body%%$'\n'*} | |
| line=${body%%$'\n'*} # Get everything after the first newline |
Slight documentation
Contributor
Author
There was a problem hiding this comment.
shouldn't it be before the first newline?
Member
There was a problem hiding this comment.
Yeha you're right, my bad
Contributor
Author
There was a problem hiding this comment.
reworded to get the first line
Use proper arguments to apply labels from original PR to backport PR. Improve target branch detection. Co-authored-by: AbsurdlyLongUsername <[email protected]>
71d4eb6 to
05a2e51
Compare
absurdlylongusername
approved these changes
Jan 8, 2026
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.
What is it?
Description of the changes in your PR
This adds a workflow to open backport PRs to another branch.
The workflow can be triggered by creating a comment on a closed PR:
/backport <TARGET_BRANCH>The backport can only be triggered by people with write access to the repository.
See this PR on my fork for a PR that was backported, has an invlaid and failed backport: TobiGr#35
Due diligence