Skip to content

Commit

Permalink
Backport script (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec authored Dec 4, 2024
1 parent f3efea6 commit 1a04fa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/actions/backport/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Git Checkout
uses: actions/checkout@v4

- name: Fetch pull request data
env:
Expand All @@ -39,6 +39,11 @@ runs:
else
echo "No backport detected."
fi
- name: Git Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.base_branch }}

- name: Backport changes
if: ${{ env.BACKPORT == 'true' }}
Expand All @@ -49,11 +54,7 @@ runs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch --all
BASE_BRANCH="${{ inputs.base_branch }}"
BACKPORT_BRANCH="backport-${{ env.PR_NUMBER }}-to-${{ inputs.base_branch }}"
git checkout $BASE_BRANCH
git checkout -b $BACKPORT_BRANCH
git cherry-pick $MERGE_COMMIT || (git cherry-pick --abort && exit 1)
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/backport-2.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Backport to v2.0
uses: ./.github/actions/backport
with:
Expand Down

0 comments on commit 1a04fa7

Please sign in to comment.