From eb0a71bab267f881ab05e76db010afd8a8ff4e50 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Sat, 14 Oct 2023 11:19:52 -0700 Subject: [PATCH 1/2] Update cherry_pick_to_stable.yaml (#1516) --- .github/workflows/cherry_pick_to_stable.yaml | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/cherry_pick_to_stable.yaml diff --git a/.github/workflows/cherry_pick_to_stable.yaml b/.github/workflows/cherry_pick_to_stable.yaml new file mode 100644 index 0000000000..14a017e12c --- /dev/null +++ b/.github/workflows/cherry_pick_to_stable.yaml @@ -0,0 +1,38 @@ +# In general, whenever a change is merged to "main" we want to replicate that change on "stable". +# This GitHub action watches for merges to "main", creates a new branch off of "stable", cherry +# picks the latest commit from "main" to the new branch, and then puts up a PR with the cherry +# pick. At that point, a reviewer waits until all tests pass, and then merges in the cherry pick +# PR. +# +# Sometimes, a change to "main" shouldn't be merged to "stable". In that case, tag the original PR +# with a "no-cherry-pick" label, and this action won't cherry pick that merge. +on: + pull_request: + branches: + - main + types: ["closed"] + +jobs: + cherry-pick-to-stable: + runs-on: ubuntu-latest + name: Cherry pick from main to stable + # Only cherry pick merged PRs. Don't merge PRs marked with "no-cherry-pick" label. + if: ${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'no-cherry-pick') }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cherry pick into release-v2.0 + uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 + with: + branch: stable + cherry-pick-branch: cherry-pick_${inputs.branch}_${commitSha} + title: 'Cherry Pick: {old_title}' + body: 'Cherry Pick: Original PR - #{old_pull_request_id}' + labels: | + cherry-pick + reviewers: | + matthew-carroll +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1d4348085c713bd4c2d78c52ea657b51fee4178a Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Sat, 14 Oct 2023 11:23:19 -0700 Subject: [PATCH 2/2] Update cherry_pick_to_stable.yaml --- .github/workflows/cherry_pick_to_stable.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cherry_pick_to_stable.yaml b/.github/workflows/cherry_pick_to_stable.yaml index 14a017e12c..bdb7ba1688 100644 --- a/.github/workflows/cherry_pick_to_stable.yaml +++ b/.github/workflows/cherry_pick_to_stable.yaml @@ -6,6 +6,7 @@ # # Sometimes, a change to "main" shouldn't be merged to "stable". In that case, tag the original PR # with a "no-cherry-pick" label, and this action won't cherry pick that merge. +name: Cherry pick to stable on: pull_request: branches: @@ -23,7 +24,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Cherry pick into release-v2.0 + - name: Cherry pick into stable uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 with: branch: stable