Automatically copy labels from original PR to backported PRs

None of the automatically generated PRs for backports can trigger the
labeler flow, which resulted in them not being added to the automatic
release notes unless manual work was done to update the labels. The
reason is that an action in a workflow can't trigger another action, and
that's by design. As referenced in an issue from the
`create-pull-request` project [1]:

> An action in a workflow run can't trigger a new workflow run. For
> example, if an action pushes code using the repository's GITHUB_TOKEN, a
> new workflow will not run even when the repository contains a workflow
> configured to run when push events occur.

On that issue, there's also a reference from a response from GH support:

> This is a deliberate decision by the Actions team in order to prevent accidental "infinite loop" situations, and as an anti-abuse measure.
> You will be able to work around this using a Personal Access Token in
> place of the provided token. As this needs to be explicitly provided it
> will remove any potential for possible abuse, so we recommend using this
> method when needing to create a pull request.

As said, we could work around that by using a personal token, which
could be scoped to the `solidusio/solidus` repository. However, we don't
think that would be a good idea because of security & practical
concerns.

Thanks to upstream work in the backporter tool [2] we can now copy the
labels from the original PR to the backported PRs, avoiding the need for
manual work.

[1] - https://github.com/peter-evans/create-pull-request/issues/48
[2] - https://github.com/sqren/backport/issues/456#issuecomment-1703967073
This commit is contained in:
Marc Busqué 2023-09-04 11:41:03 +02:00
parent 48f15799bb
commit 6ecc1a181a
No known key found for this signature in database
GPG Key ID: BA8FAA6BC32B8224

View File

@ -1,3 +1,4 @@
{
"prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}"
"prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}",
"copySourcePRLabels": true
}