Skip to content

Commit

Permalink
Merge pull request #23 from informalsystems/ph/automate-backport
Browse files Browse the repository at this point in the history
Add backport action
  • Loading branch information
p-offtermatt authored Aug 18, 2023
2 parents d0c0c97 + d9ef041 commit 439adec
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Backport PRs
on:
pull_request:
types:
- closed

jobs:
backport-v0_34_x:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport-v0.34.x')
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 }}"
backport-v0_37_x:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport-v0.37.x')
steps:
- name: Check out code
uses: actions/checkout@v2

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

- 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 439adec

Please sign in to comment.