Skip to content

Commit

Permalink
Automatically copy labels from original PR to backported PRs
Browse files Browse the repository at this point in the history
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] - peter-evans/create-pull-request#48
[2] - sorenlouv/backport#456 (comment)
  • Loading branch information
waiting-for-dev committed Sep 4, 2023
1 parent 68e438a commit 4f58428
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}"
"prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}",
"copySourcePRLabels": true
}

0 comments on commit 4f58428

Please sign in to comment.