sorenlouv / backport

A simple CLI tool that automates the process of backporting commits on a GitHub repo
https://github.com/sqren/backport/blob/main/docs/config-file-options.md
Apache License 2.0
241 stars 57 forks source link

Option to copy labels from target to source #456

Closed waiting-for-dev closed 10 months ago

waiting-for-dev commented 1 year ago

Hey! Thanks a lot for working on this useful tool! We'd like to request a feature that would probably help other people, too.

The automatically generated PRs cannot run other pull_request or pull_request_event workflows. That's a decision by design from the GitHub team. See https://github.com/peter-evans/create-pull-request/issues/48 for details.

A common use case (hitting us) is having a workflow that automatically applies some labels to a PR. As explained, that workflow can't run on the backported PRs. A good workaround would be having the backport action create the PRs with the same labels as the target PR (without the ones used to backport).

sorenlouv commented 1 year ago

Hey @waiting-for-dev

That makes sense. I think I've seen that request before so I'm sure it'd be useful for others as well. I'll see what I can do.

sorenlouv commented 1 year ago

This behaviour would be disabled by default so you would have to enable it. WDYT about a setting in .backportrc.json like:

{
  copySourcePrLabels: true
}

It should also be possible to invoke on demand like:

backport --pr 1337 --copy-source-pr-labels

WDYT?

waiting-for-dev commented 1 year ago

Thanks for getting back @sqren. I think it's a great idea not having it enabled by default 👍

sorenlouv commented 10 months ago

Hi @waiting-for-dev

Sorry for dropping this! I finally got around to implementing this in https://github.com/sqren/backport/pull/474. It has been released in v9.3.0.

I'm very interested to hear if this works for you!

waiting-for-dev commented 10 months ago

That's awesome :raised_hands: I tried it, and works great. I added the changes to https://github.com/solidusio/solidus/pull/5365 Many thanks!