Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalise backport action #266

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions .github/workflows/backport-starting-v511.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,11 @@ on:
jobs:
backport:
strategy:
fail-fast: false
matrix:
branch: ['v/5.11','v/5.12','v/5.13','v/5.14']
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 backport label
id: check_pr_labels
uses: shioyang/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
labels: '["backport starting from 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
uses: hazelcast/hz-docs/.github/workflows/backport-workflow.yml@main
with:
label-to-check-for: '["backport starting from 5.11"]'
target-branch: v/${{ matrix.branch }}
secrets: inherit
40 changes: 0 additions & 40 deletions .github/workflows/backport-v511.yml

This file was deleted.

56 changes: 26 additions & 30 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,33 @@ on:
branches:
- main
jobs:
backport:
strategy:
matrix:
branch: ['v/5.8', 'v/5.9', 'v/5.10']
get-maintenance-branches:
runs-on: ubuntu-latest
outputs:
branches: "['5.8', '5.9', '5.10', '5.11', '5.12', '5.13', '5.14']"
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"]'

- name: See result
run: echo "${{ steps.check_pr_labels.outputs.result }}"
backport-to-all-branch:
needs: get-maintenance-branches
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }}
uses: hazelcast/hz-docs/.github/workflows/backport-workflow.yml@main
with:
label-to-check-for: '["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: false
matrix:
branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }}
uses: hazelcast/hz-docs/.github/workflows/backport-workflow.yml@main
with:
label-to-check-for: '["backport to ${{ matrix.branch }}"]'
target-branch: v/${{ matrix.branch }}
secrets: inherit
Loading