diff --git a/.github/workflows/ci-cherry-pick.yml b/.github/workflows/ci-cherry-pick.yml index b9ee1f88ab..ca89ba8850 100644 --- a/.github/workflows/ci-cherry-pick.yml +++ b/.github/workflows/ci-cherry-pick.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - fix/* types: - closed @@ -18,6 +19,7 @@ jobs: uses: actions/checkout@v3 with: ref: main + fetch-depth: 0 - name: Configure Git run: | @@ -34,27 +36,26 @@ jobs: 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 - git checkout $RELEASE_BRANCH - git checkout -b $BRANCH + git cherry-pick -x $COMMIT_SHA - - name: Push to Remote - run: | - git push origin ${{ env.BRANCH }} - - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }} commit-message: Cherry-picked from ${{ env.COMMIT_SHA }} title: "Cherry-Pick ${{ env.COMMIT_SHA }} to ${{ env.RELEASE_BRANCH }}" - branch: ${{ env.BRANCH }} + body: | + This is an automated cherry-pick of ${{ env.COMMIT_SHA }} to ${{ env.RELEASE_BRANCH }}. + Please review and merge if appropriate. + Original PR: ${{ github.event.pull_request.html_url }} + branch: pick/non-breaking base: '${{ env.RELEASE_BRANCH }}' reviewers: 'martin-chainflip' labels: cherry-pick + branch-suffix: timestamp + delete-branch: true - name: Notify on failed cherry-pick if: failure() || cancelled()