From 031ea8124ced3bb2bd5522933140713d0c4d8362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Mon, 24 May 2021 17:42:28 +0200 Subject: [PATCH 1/5] Add backporting action If "backport " label is applied to a PR, once the PR is merged, github-actions bot will create another PR targeting and cherry-picking commits. --- .github/workflows/backport.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000000..375132133ca --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,20 @@ +name: Backport +on: + pull_request: + types: [closed] +jobs: + backport: + name: Create backport PRs + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + with: + # required to find all branches + fetch-depth: 0 + - name: Create backport PRs + uses: zeebe-io/backport-action@9b8949dcd4295d364b0939f07d0c7593598d26cd + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }} + version: 9b8949dcd4295d364b0939f07d0c7593598d26cd From fb3da87aa39f6786e808521a821e0fd24aae2743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 25 May 2021 07:14:12 +0200 Subject: [PATCH 2/5] Update .github/workflows/backport.yml Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com> --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 375132133ca..591867c8399 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -5,7 +5,7 @@ on: jobs: backport: name: Create backport PRs - if: github.event.pull_request.merged == true + if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 From 68e65592e32117e7c15e87ec60d4147f37d7b0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 25 May 2021 09:41:07 +0200 Subject: [PATCH 3/5] Update .github/workflows/backport.yml Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com> --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 591867c8399..9c1ddfadfca 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -8,7 +8,7 @@ jobs: if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2 with: # required to find all branches fetch-depth: 0 From b26fc090cb4b35c923fc636cbdfd6b7346319587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 25 May 2021 09:44:35 +0200 Subject: [PATCH 4/5] backport action: comment to keep pin in sync --- .github/workflows/backport.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 9c1ddfadfca..69da652ba59 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -13,8 +13,10 @@ jobs: # required to find all branches fetch-depth: 0 - name: Create backport PRs + # should be kept in sync with `version` uses: zeebe-io/backport-action@9b8949dcd4295d364b0939f07d0c7593598d26cd with: github_token: ${{ secrets.GITHUB_TOKEN }} github_workspace: ${{ github.workspace }} + # should be kept in sync with `uses` version: 9b8949dcd4295d364b0939f07d0c7593598d26cd From 51c7afa95e58bc7f58c081509f046f9d49aa5041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 25 May 2021 09:47:33 +0200 Subject: [PATCH 5/5] backport action: document the workflow --- doc/contributing/submitting-changes.chapter.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/contributing/submitting-changes.chapter.md b/doc/contributing/submitting-changes.chapter.md index b462caf8670..0a465020092 100644 --- a/doc/contributing/submitting-changes.chapter.md +++ b/doc/contributing/submitting-changes.chapter.md @@ -248,6 +248,8 @@ For cherry-picking a commit to a stable release branch (“backporting”), use Add a reason for the backport by using `git cherry-pick -xe ` instead when it is not obvious from the original commit message. It is not needed when it's a minor version update that includes security and bug fixes but don't add new features or when the commit fixes an otherwise broken package. +For backporting Pull Requests to stable branches, assign label `backport ` to the original Pull Requests and automation should take care of the rest once the Pull Requests is merged. + Here is an example of a cherry-picked commit message with good reason description: ```