-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding action to backport to 5.11 (#196)
- Loading branch information
1 parent
7a4d1e7
commit a7aaa40
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Backport changes to 5.11 branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
backport: | ||
strategy: | ||
matrix: | ||
branch: ['v/5.11'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up git config | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
- name: Check PR for backport label | ||
id: check_pr_labels | ||
uses: shioyang/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: '["backport to 5.11"]' | ||
|
||
- name: See result | ||
run: echo "${{ steps.check_pr_labels.outputs.result }}" | ||
|
||
- name: Checkout maintenance branch and cherry-pick | ||
if: ${{ steps.check_pr_labels.outputs.result == 'true' }} | ||
run: | | ||
git fetch | ||
git checkout ${{ matrix.branch }} | ||
git cherry-pick -x --strategy=recursive -X theirs $GITHUB_SHA | ||
git push |