Skip to content

Commit

Permalink
Add backport action
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Aug 18, 2023
1 parent d0c0c97 commit 4267b38
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Backport PRs
on:
pull_request:
types:
- closed

jobs:
backport:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport')
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install Hub CLI
run: sudo snap install --classic hub

- name: Backport to v0.34.x
run: |
git checkout v0.34.x
git cherry-pick ${{ github.event.pull_request.merge_commit_sha }}
git push
hub pull-request -m "Backport: ${{ github.event.pull_request.title }}"
- name: Backport to v0.37.x
run: |
git checkout v0.37.x
git cherry-pick ${{ github.event.pull_request.merge_commit_sha }}
git push
hub pull-request -m "Backport: ${{ github.event.pull_request.title }}"

0 comments on commit 4267b38

Please sign in to comment.