-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f65371
commit 2f43cb0
Showing
9 changed files
with
75 additions
and
303 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
name: Backport changes | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
label: | ||
description: Triggering label to check for | ||
required: true | ||
type: string | ||
target-branch: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
backport: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check PR for backport label | ||
id: check_pr_labels | ||
uses: shioyang/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: ${{ inputs.label }} | ||
|
||
- name: See result | ||
run: echo "${{ steps.check_pr_labels.outputs.result }}" | ||
|
||
- name: Checkout repository | ||
if: ${{ steps.check_pr_labels.outputs.result == 'true' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Checkout maintenance branch and cherry-pick | ||
if: ${{ steps.check_pr_labels.outputs.result == 'true' }} | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git fetch | ||
git checkout ${{ inputs.target-branch }} | ||
git cherry-pick -x --strategy=recursive -X theirs $GITHUB_SHA | ||
git push |
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 |
---|---|---|
|
@@ -4,37 +4,33 @@ on: | |
branches: | ||
- main | ||
jobs: | ||
backport: | ||
strategy: | ||
matrix: | ||
branch: ['v/5.0', 'v/5.1', 'v/5.2', 'v/5.3', 'v/5.4', 'v/5.5'] | ||
get-maintenance-branches: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branches: "['5.0', '5.1', '5.2', '5.3', '5.4', '5.5']" | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: exit 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 all versions"]' | ||
|
||
- name: See result | ||
run: echo "${{ steps.check_pr_labels.outputs.result }}" | ||
backport-to-all-branch: | ||
needs: get-maintenance-branches | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }} | ||
uses: ./.github/workflows/backport-workflow.yml | ||
with: | ||
label: '["backport to all versions"]' | ||
target-branch: v/${{ matrix.branch }} | ||
secrets: inherit | ||
|
||
- 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 | ||
backport-to-specified-branch: | ||
needs: get-maintenance-branches | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }} | ||
uses: ./.github/workflows/backport-workflow.yml | ||
with: | ||
label: '["backport to ${{ matrix.branch }}"]' | ||
target-branch: v/${{ matrix.branch }} | ||
secrets: inherit |
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 |
---|---|---|
|
@@ -5,36 +5,8 @@ on: | |
- v/* | ||
jobs: | ||
forwardport: | ||
strategy: | ||
matrix: | ||
branch: ['main'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
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 forwardport label | ||
id: check_pr_labels | ||
uses: shioyang/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: '["forwardport to snapshot"]' | ||
|
||
- name: See result | ||
run: echo "${{ steps.check_pr_labels.outputs.result }}" | ||
|
||
- name: Checkout 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 | ||
uses: ./.github/workflows/backport-workflow.yml | ||
with: | ||
label: '["forwardport to snapshot"]' | ||
target-branch: main | ||
secrets: inherit |