korthout / backport-action

Fast and flexible GitHub action to cherry-pick merged pull requests to selected branches
MIT License
61 stars 26 forks source link

feat: allow to backport unmerged prs #411

Open tasso94 opened 8 months ago

tasso94 commented 8 months ago

This pull request is still a work in progress, but I wanted to share my first iteration to get feedback early on:

  1. Whether it generally makes sense and if you want to merge it with your upstream.
  2. If the technical design of the feature makes sense.

User story

As a user, I want to backport a PR that is still WIP and not merged with the master branch to allow running the CI on my maintenance branches.

Open tasks

I think the following topics still need to be addressed (is there even more I might not know yet?):

korthout commented 7 months ago

Thanks @tasso94 ❤️

💭 It's important that backport-action doesn't automatically backport unmerged pull requests, as this could be unsafe in some repository workflows. But I do see that this could be useful to some as well. It should be a decision that the repository maintainer(s) can make.

👍 So I like the idea of adding this as an input, where the default behavior disallows backporting unmerged pull requests.

👍 I think the technical design makes sense.

🔧 We can clarify in the issue comment that the maintainer can use this input to allow unmerged pull requests.

[!IMPORTANT] Maintainers who want to enforce this input must avoid using the pull_request event to run the backport action. The pull_request event could allow the pull request author to flip the input flag before the pull request is approved and merged. The pull_request_target event prevents this. Note that backport-action promotes using the pull_request_target event in its readme.