Skip to content

Conversation

@TobiGr
Copy link
Contributor

@TobiGr TobiGr commented Dec 28, 2025

What is it?

  • Meta improvement to the project (dev facing)

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

@TobiGr TobiGr added the meta Related to the project but not strictly to code label Dec 28, 2025
@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Dec 28, 2025
Comment on lines 49 to 50
add_labels: ${{ env.BACKPORT_PR_LABELS }}
target_branches: ${{ env.BACKPORT_TARGET }} No newline at end of file

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.
@TobiGr TobiGr force-pushed the backport-workflow branch from aa030be to 71d4eb6 Compare January 7, 2026 11:43
@github-actions github-actions bot added size/small PRs with less than 50 changed lines and removed size/medium PRs with less than 250 changed lines labels Jan 7, 2026
@TobiGr
Copy link
Contributor Author

TobiGr commented Jan 7, 2026

You can see that the changes work in TobiGr#39

set -euo pipefail
body="${{ github.event.comment.body }}"

line=${body%%$'\n'*}

Choose a reason for hiding this comment

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

Suggested change
line=${body%%$'\n'*}
line=${body%%$'\n'*} # Get everything after the first newline

Slight documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shouldn't it be before the first newline?

Choose a reason for hiding this comment

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

Yeha you're right, my bad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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]>
@TobiGr TobiGr force-pushed the backport-workflow branch from 71d4eb6 to 05a2e51 Compare January 8, 2026 00:17
@TobiGr TobiGr merged commit d36a9f0 into TeamNewPipe:dev Jan 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to the project but not strictly to code size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants