-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add workflow to backport PRs to another branch #12964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.github/workflows/backport-pr.yml
Outdated
| add_labels: ${{ env.BACKPORT_PR_LABELS }} | ||
| target_branches: ${{ env.BACKPORT_TARGET }} No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
There was a problem hiding this comment.
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.
aa030be to
71d4eb6
Compare
|
You can see that the changes work in TobiGr#39 |
.github/workflows/backport-pr.yml
Outdated
| set -euo pipefail | ||
| body="${{ github.event.comment.body }}" | ||
|
|
||
| line=${body%%$'\n'*} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| line=${body%%$'\n'*} | |
| line=${body%%$'\n'*} # Get everything after the first newline |
Slight documentation
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
71d4eb6 to
05a2e51
Compare
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