From 48f15799bbf640ab1456c673e1ef9d79829935ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Thu, 31 Aug 2023 10:57:10 +0200 Subject: [PATCH 1/2] Make automatic backporting PRs take the title from the original one Up until now, the title of the backporting PRs was the name of the merge commit, which is not very readable. This commit builds the title from the original PR title and the target branch, e.g.: [v4.2] Fix some bug This is now possible thanks to upstream's recent changes. See https://github.com/sqren/backport/issues/455 for details. --- .backportrc.json | 3 +++ .github/workflows/backport.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .backportrc.json diff --git a/.backportrc.json b/.backportrc.json new file mode 100644 index 00000000000..843ca2205da --- /dev/null +++ b/.backportrc.json @@ -0,0 +1,3 @@ +{ + "prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}" +} diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 2f624ff521e..53e8d7d6acf 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -18,7 +18,7 @@ jobs: ) steps: - name: Backport Action - uses: sqren/backport-github-action@v8.9.3 + uses: sqren/backport-github-action@v9.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} auto_backport_label_prefix: backport- From 6ecc1a181a560b785707fd8108c6f70273b99c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Mon, 4 Sep 2023 11:41:03 +0200 Subject: [PATCH 2/2] 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 --- .backportrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.backportrc.json b/.backportrc.json index 843ca2205da..9fa94bfea98 100644 --- a/.backportrc.json +++ b/.backportrc.json @@ -1,3 +1,4 @@ { - "prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}" + "prTitle": "[{{targetBranch}}] {{sourcePullRequest.title}}", + "copySourcePRLabels": true }