Skip to content
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

Add backport workflow #9172

Merged
merged 1 commit into from
Dec 2, 2023
Merged

Add backport workflow #9172

merged 1 commit into from
Dec 2, 2023

Conversation

joshcooper
Copy link
Contributor

If a label starting with "backport " is applied to an already merged PR then create a new PR against where the commits are cherry picked from the original PR using the '-x' flag to include the original git ref.

Note the pull_request_target trigger comes with a security warning[1]:

you should make sure that you do not check out, build, or run untrusted
code from the pull request with this event.

To guard against this we only run if the label is applied to an already merged PR and not a closed, but unmerged PR.

[1] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

@joshcooper joshcooper added the maintenance Maintenance chores are excluded from changelogs label Nov 29, 2023
If a label starting with "backport <branch>" is applied to an already merged PR
then create a new PR against <branch> where the commits are cherry picked from
the original PR using the '-x' flag to include the original git ref.

Note the pull_request_target trigger comes with a security warning[1]:

    you should make sure that you do not check out, build, or run untrusted
    code from the pull request with this event.

To guard against this we only run if the label is applied to an already merged
PR and not a closed, but unmerged PR.

[1] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
@joshcooper joshcooper marked this pull request as ready for review December 1, 2023 17:09
@joshcooper joshcooper requested a review from a team as a code owner December 1, 2023 17:09
@joshcooper joshcooper merged commit 162fce6 into puppetlabs:main Dec 2, 2023
9 checks passed
@joshcooper joshcooper deleted the backport branch December 2, 2023 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants