From 5678c734ca63bafcbfea23c437e9322863815e54 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 16:57:11 +0100 Subject: [PATCH 01/24] chore: auto pick --- .github/workflows/ci-cherry-pick.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci-cherry-pick.yml diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml new file mode 100644 index 0000000000..6185a6ecf3 --- /dev/null +++ b/.github/workflows/ci-cherry-pick.yml @@ -0,0 +1,54 @@ +name: Cherry-Pick to Release Branch + +on: + pull_request: + branches: + - pla-1142 + types: + - closed + +run-name: Cherry pick {{ github.event.pull_request.title }} to release branch + +jobs: + cherry-pick: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'non-breaking') + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + with: + ref: 'main' + + - name: Configure Git + run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + + - name: Cherry-pick commit + run: | + DATE=$(date +%s) + echo "DATE=$DATE" >> $GITHUB_ENV + COMMIT_SHA=$(git rev-parse HEAD) + git checkout -b cherry-pick-branch-$DATE + git cherry-pick -x $COMMIT_SHA + + - name: Push to Remote + run: | + git push origin cherry-pick-branch-$DATE + + - name: Find latest release branch + run: | + RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) + echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV + + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} + commit-message: Cherry-picked from ${{ github.event.pull_request.head.sha }} + title: "Cherry-Pick: ${{ github.event.pull_request.title }}" + branch: cherry-pick-branch-{{ env.DATE }} + base: '{{ env.RELEASE_BRANCH }}' # Update with your current release branch + reviewers: 'martin-chainflip' + labels: cherry-pick From c5443e4e3bde102a18f99c5b5c32d217cb7929c0 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 16:59:25 +0100 Subject: [PATCH 02/24] fix: correct env --- .github/workflows/ci-cherry-pick.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 6185a6ecf3..bf754f8319 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -26,15 +26,15 @@ jobs: - name: Cherry-pick commit run: | - DATE=$(date +%s) - echo "DATE=$DATE" >> $GITHUB_ENV + BRANCH=pick/non-breaking-$(date +%s) + echo "BRANCH=$BRANCH" >> $GITHUB_ENV COMMIT_SHA=$(git rev-parse HEAD) - git checkout -b cherry-pick-branch-$DATE + git checkout -b $BRANCH git cherry-pick -x $COMMIT_SHA - name: Push to Remote run: | - git push origin cherry-pick-branch-$DATE + git push origin ${{ env.BRANCH }} - name: Find latest release branch run: | @@ -48,7 +48,7 @@ jobs: token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} commit-message: Cherry-picked from ${{ github.event.pull_request.head.sha }} title: "Cherry-Pick: ${{ github.event.pull_request.title }}" - branch: cherry-pick-branch-{{ env.DATE }} - base: '{{ env.RELEASE_BRANCH }}' # Update with your current release branch + branch: ${{ env.BRANCH }} + base: '${{ env.RELEASE_BRANCH }}' # Update with your current release branch reviewers: 'martin-chainflip' labels: cherry-pick From 3766597315bdf39ed9aa32764e5c16e71431f501 Mon Sep 17 00:00:00 2001 From: tomjohnburton <39559415+tomjohnburton@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:00:25 +0400 Subject: [PATCH 03/24] change (#4499) --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index bf754f8319..c19bbd345e 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -41,7 +41,7 @@ jobs: RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV - +# - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: From fecc33aa6ce2bb7a7b0b7354264fef9b74eab00d Mon Sep 17 00:00:00 2001 From: tomjohnburton <39559415+tomjohnburton@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:09:00 +0400 Subject: [PATCH 04/24] change (#4501) --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index c19bbd345e..d919f0dac6 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -41,7 +41,7 @@ jobs: RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV -# +#2 - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: From f65c98f89d730da08461d2bec8d678d5e083eee5 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:31:12 +0100 Subject: [PATCH 05/24] [pick] --- .github/pull_request_template.md | 6 ++++++ .github/workflows/ci-cherry-pick.yml | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 462c291677..3847aa03f3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,13 @@ Please conduct a thorough self-review before opening the PR. - [ ] I am confident that the code works. - [ ] I have updated documentation where appropriate. +- [ ] If the PR is `non-breaking`, I have added `non-breaking` to the title of the PR. ## Summary *Please include a succinct description of the purpose and content of the PR. What problem does it solve, and how? Link issues, discussions, other PRs, and anything else that will help the reviewer.* + + +#### Non-Breaking changes + +If this PR includes non-breaking changes, you can add `non-breaking` to the title of the PR. This will create a PR against the latest release branch. \ No newline at end of file diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index c19bbd345e..5c81953edb 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -1,23 +1,19 @@ name: Cherry-Pick to Release Branch on: - pull_request: + push: branches: - pla-1142 - types: - - closed -run-name: Cherry pick {{ github.event.pull_request.title }} to release branch +run-name: Cherry pick `${{ github.sha }}` to release branch jobs: cherry-pick: - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'non-breaking') + if: github.event.head_commit.message =~ /\[pick\]/ runs-on: ubuntu-latest steps: - name: Checkout main branch uses: actions/checkout@v3 - with: - ref: 'main' - name: Configure Git run: | @@ -29,6 +25,7 @@ jobs: BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV COMMIT_SHA=$(git rev-parse HEAD) + echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV git checkout -b $BRANCH git cherry-pick -x $COMMIT_SHA From ed90458c9009bf66513f92f69e5afd845912146b Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:32:53 +0100 Subject: [PATCH 06/24] [pick] --- .github/pull_request_template.md | 4 ++-- .github/workflows/ci-cherry-pick.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3847aa03f3..bc6f71e999 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,7 @@ Please conduct a thorough self-review before opening the PR. - [ ] I am confident that the code works. - [ ] I have updated documentation where appropriate. -- [ ] If the PR is `non-breaking`, I have added `non-breaking` to the title of the PR. +- [ ] If the PR is `non-breaking`, I have added `[pick]` to the title of the PR. ## Summary @@ -17,4 +17,4 @@ Please conduct a thorough self-review before opening the PR. #### Non-Breaking changes -If this PR includes non-breaking changes, you can add `non-breaking` to the title of the PR. This will create a PR against the latest release branch. \ No newline at end of file +If this PR includes non-breaking changes, you can add `[pick]` to the title of the PR. This will create a PR against the latest release branch. \ No newline at end of file diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 0137e4c48a..1daa137577 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -9,7 +9,7 @@ run-name: Cherry pick `${{ github.sha }}` to release branch jobs: cherry-pick: - if: github.event.head_commit.message =~ /\[pick\]/ + if: contains(github.event.head_commit.message, '[pick]') runs-on: ubuntu-latest steps: - name: Checkout main branch From ef6f5bb252100921c158ca4b0c2f63d70da3d200 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:35:14 +0100 Subject: [PATCH 07/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 1daa137577..e29f56dff9 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -22,10 +22,13 @@ jobs: - name: Cherry-pick commit run: | + RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) + echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV COMMIT_SHA=$(git rev-parse HEAD) - echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV + + git checkout $RELEASE_BRANCH git checkout -b $BRANCH git cherry-pick -x $COMMIT_SHA @@ -33,12 +36,6 @@ jobs: run: | git push origin ${{ env.BRANCH }} - - name: Find latest release branch - run: | - RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) - echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV - -#2 - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: From 02c84cd29fb78b94de03e88085e7dbd0ac44e4f6 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:36:01 +0100 Subject: [PATCH 08/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index e29f56dff9..52a4b0f9f6 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -22,6 +22,7 @@ jobs: - name: Cherry-pick commit run: | + set -x RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV BRANCH=pick/non-breaking-$(date +%s) From 5d1d7f12a617f55ca998e79388135295d13909a5 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:37:42 +0100 Subject: [PATCH 09/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 52a4b0f9f6..0b45b2fefb 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -23,6 +23,7 @@ jobs: - name: Cherry-pick commit run: | set -x + git fetch --all RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV BRANCH=pick/non-breaking-$(date +%s) From c2314996b6740a350e8345fe0a909f79ca39753f Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Wed, 7 Feb 2024 17:38:59 +0100 Subject: [PATCH 10/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 0b45b2fefb..8145aad8de 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -24,10 +24,12 @@ jobs: run: | set -x git fetch --all - RELEASE_BRANCH=$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1) - echo "RELEASE_BRANCH=release/$RELEASE_BRANCH" >> $GITHUB_ENV + RELEASE_BRANCH="release/$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1)" + echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV + BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV + COMMIT_SHA=$(git rev-parse HEAD) git checkout $RELEASE_BRANCH From c66aa61bc2335bb27315cc3f72568d3f4319b737 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Fri, 9 Feb 2024 13:28:50 +0100 Subject: [PATCH 11/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 8145aad8de..c095a8210b 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -30,7 +30,7 @@ jobs: BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV - COMMIT_SHA=$(git rev-parse HEAD) + COMMIT_SHA=${{ github.event.pull_request.head.sha }} git checkout $RELEASE_BRANCH git checkout -b $BRANCH @@ -45,7 +45,7 @@ jobs: with: token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} commit-message: Cherry-picked from ${{ github.event.pull_request.head.sha }} - title: "Cherry-Pick: ${{ github.event.pull_request.title }}" + title: "Cherry-Pick ${{ github.event.pull_request.head.sha }} to ${{ env.RELEASE_BRANCH }}" branch: ${{ env.BRANCH }} base: '${{ env.RELEASE_BRANCH }}' # Update with your current release branch reviewers: 'martin-chainflip' From 79543f0ee3a7c09edf1dda10e75ec4bf734b490f Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Fri, 9 Feb 2024 13:29:57 +0100 Subject: [PATCH 12/24] [pick] --- .github/workflows/ci-cherry-pick.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index c095a8210b..a749ba6736 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -30,7 +30,7 @@ jobs: BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV - COMMIT_SHA=${{ github.event.pull_request.head.sha }} + COMMIT_SHA=${{ github.sha }} git checkout $RELEASE_BRANCH git checkout -b $BRANCH @@ -44,8 +44,8 @@ jobs: uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} - commit-message: Cherry-picked from ${{ github.event.pull_request.head.sha }} - title: "Cherry-Pick ${{ github.event.pull_request.head.sha }} to ${{ env.RELEASE_BRANCH }}" + commit-message: Cherry-picked from ${{ env.COMMIT_SHA }} + title: "Cherry-Pick ${{ env.COMMIT_SHA }} to ${{ env.RELEASE_BRANCH }}" branch: ${{ env.BRANCH }} base: '${{ env.RELEASE_BRANCH }}' # Update with your current release branch reviewers: 'martin-chainflip' From 464e84a9960facf625fd2cc42b51fbf6bc1234d5 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Fri, 9 Feb 2024 13:52:52 +0100 Subject: [PATCH 13/24] fix: correct namespace --- .github/workflows/ci-cherry-pick.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index a749ba6736..e03b3bfcd5 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -3,7 +3,7 @@ name: Cherry-Pick to Release Branch on: push: branches: - - pla-1142 + - main run-name: Cherry pick `${{ github.sha }}` to release branch @@ -12,7 +12,7 @@ jobs: if: contains(github.event.head_commit.message, '[pick]') runs-on: ubuntu-latest steps: - - name: Checkout main branch + - name: Checkout branch uses: actions/checkout@v3 - name: Configure Git From f9c3f2bed9f794daeafbe42e5dc62e5660ff6863 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Fri, 9 Feb 2024 14:00:36 +0100 Subject: [PATCH 14/24] chore: add notification --- .github/workflows/ci-cherry-pick.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index e03b3bfcd5..1cf860a1c6 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -50,3 +50,14 @@ jobs: base: '${{ env.RELEASE_BRANCH }}' # Update with your current release branch reviewers: 'martin-chainflip' labels: cherry-pick + + - name: Notify on failed cherry-pick + if: failure() || cancelled() + env: + DISCORD_USERNAME: "Release Picker" + DISCORD_WEBHOOK: ${{ secrets.CF_DISCORD_ALERTS_CRITICAL }} + uses: Ilshidur/action-discord@0.3.2 + with: + args: | + 🍒⚠️ Sorry **${{ github.actor }}**, The attempt to cherry-pick `${{ env.COMMIT_SHA }}` on to `${{ env.RELEASE_BRANCH }}` was unsuccessful + Please check the [GitHub job](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see what went wrong. From 609f6815afbc2bd4f2aa08d63684c8369e868aa8 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 09:23:03 +0100 Subject: [PATCH 15/24] chore: use PR and labels --- .github/workflows/ci-cherry-pick.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 1cf860a1c6..8a1a9030f0 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -1,19 +1,23 @@ name: Cherry-Pick to Release Branch on: - push: + pull_request: branches: - main + types: + - closed run-name: Cherry pick `${{ github.sha }}` to release branch jobs: cherry-pick: - if: contains(github.event.head_commit.message, '[pick]') + if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'non-breaking')) }} runs-on: ubuntu-latest steps: - name: Checkout branch uses: actions/checkout@v3 + with: + ref: main - name: Configure Git run: | From 3451a0074fe13ce4def9d6311403d7ddafada8b3 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 15:19:09 +0100 Subject: [PATCH 16/24] fix: revert to pr closed --- .github/workflows/ci-cherry-pick.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 8a1a9030f0..406e74f892 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - pla-1142 types: - closed @@ -28,14 +29,14 @@ jobs: run: | set -x git fetch --all + COMMIT_SHA=$(git rev-parse HEAD) + RELEASE_BRANCH="release/$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1)" echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV BRANCH=pick/non-breaking-$(date +%s) echo "BRANCH=$BRANCH" >> $GITHUB_ENV - COMMIT_SHA=${{ github.sha }} - git checkout $RELEASE_BRANCH git checkout -b $BRANCH git cherry-pick -x $COMMIT_SHA From 8111b642f7151e8a932834cc473a66e57214365d Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 15:23:32 +0100 Subject: [PATCH 17/24] fix: do with ref --- .github/workflows/ci-cherry-pick.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 406e74f892..6af0755ce2 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -8,7 +8,7 @@ on: types: - closed -run-name: Cherry pick `${{ github.sha }}` to release branch +run-name: Cherry pick `${{ github.event.pull_request.title }}` to release branch jobs: cherry-pick: @@ -18,7 +18,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v3 with: - ref: main + ref: pla-1142 - name: Configure Git run: | From c1fa6bfc1cf84db89880d7b0190c6ee389d0874f Mon Sep 17 00:00:00 2001 From: tomjohnburton <39559415+tomjohnburton@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:31:38 +0100 Subject: [PATCH 18/24] fake (#4522) --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 6af0755ce2..8089332c05 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -1,5 +1,5 @@ name: Cherry-Pick to Release Branch - +# on: pull_request: branches: From 5a20320f5e7526e9cf87b3af2388ee5217053f68 Mon Sep 17 00:00:00 2001 From: tomjohnburton <39559415+tomjohnburton@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:33:42 +0100 Subject: [PATCH 19/24] fake (#4524) --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 8089332c05..6af0755ce2 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -1,5 +1,5 @@ name: Cherry-Pick to Release Branch -# + on: pull_request: branches: From 83c236c4a502ebfd8120c2a9d8875a7c8af65eda Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 17:38:38 +0100 Subject: [PATCH 20/24] chore: add commit sha --- .github/workflows/ci-cherry-pick.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 6af0755ce2..8d692b3298 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -30,6 +30,7 @@ jobs: set -x git fetch --all COMMIT_SHA=$(git rev-parse HEAD) + echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV RELEASE_BRANCH="release/$(git branch -r | grep 'origin/release/[0-9]\+\.[0-9]' | sed 's/.*release\///' | sort -V | tail -n1)" echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV From 9021a151d0b88dc899a05b60d84c94045cd75777 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 17:38:53 +0100 Subject: [PATCH 21/24] chore: remove pla-14432 --- .github/workflows/ci-cherry-pick.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 8d692b3298..20fd9c45e9 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -4,7 +4,6 @@ on: pull_request: branches: - main - - pla-1142 types: - closed From 581447152e279748181c39067209f2250da38cf2 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 17:42:53 +0100 Subject: [PATCH 22/24] chore: improve readme --- .github/pull_request_template.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index bc6f71e999..b267a84ff9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,6 @@ Please conduct a thorough self-review before opening the PR. - [ ] I am confident that the code works. - [ ] I have updated documentation where appropriate. -- [ ] If the PR is `non-breaking`, I have added `[pick]` to the title of the PR. ## Summary @@ -17,4 +16,4 @@ Please conduct a thorough self-review before opening the PR. #### Non-Breaking changes -If this PR includes non-breaking changes, you can add `[pick]` to the title of the PR. This will create a PR against the latest release branch. \ No newline at end of file +If this PR includes non-breaking changes, select the `non-breaking` label. On merge, CI will automatically cherry-pick the commit to a PR against the release branch. \ No newline at end of file From 79c8efbf8a9d1609a2d6fa077ff25dcd12a6b782 Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 17:43:34 +0100 Subject: [PATCH 23/24] fix: remove comment --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index 20fd9c45e9..c876ead49e 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -52,7 +52,7 @@ jobs: commit-message: Cherry-picked from ${{ env.COMMIT_SHA }} title: "Cherry-Pick ${{ env.COMMIT_SHA }} to ${{ env.RELEASE_BRANCH }}" branch: ${{ env.BRANCH }} - base: '${{ env.RELEASE_BRANCH }}' # Update with your current release branch + base: '${{ env.RELEASE_BRANCH }}' reviewers: 'martin-chainflip' labels: cherry-pick From 2b09599cd50aa51671b6f885263d78db5ea9795d Mon Sep 17 00:00:00 2001 From: Thomas Burton Date: Tue, 13 Feb 2024 17:45:43 +0100 Subject: [PATCH 24/24] fix: set base commit as main --- .github/workflows/ci-cherry-pick.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index c876ead49e..b9ee1f88ab 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v3 with: - ref: pla-1142 + ref: main - name: Configure Git run: |