Skip to content

Commit

Permalink
fix: pull first (#4526)
Browse files Browse the repository at this point in the history
* fix: pull first

* test (#4527)

* chore: test on fix branches

* tet (#4528)

* tet (#4529)

* chore: add fetch depth 0

* test (#4530)

* fix: don't checkout branch

* test (#4531)

* chore: add body
  • Loading branch information
tomjohnburton authored Feb 14, 2024
1 parent 5894480 commit 0b11cde
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci-cherry-pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- fix/*
types:
- closed

Expand All @@ -18,6 +19,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0

- name: Configure Git
run: |
Expand All @@ -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()
Expand Down

0 comments on commit 0b11cde

Please sign in to comment.