Skip to content

mtupitsyn/backport-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backport-action

GitHub Action to backport pull requests.

Put this in your .github/workflows/backport.yml:

name: Backport

on:
  pull_request:
    types:
      - closed
      - labeled

jobs:
  backport:
    runs-on: ubuntu-latest
    name: Backport closed pull request
    steps:
    - uses: syndesisio/backport-action@v1

And for each pull request that needs to be backported to branch <branch> add a backport <branch> label on the pull request.

This fork of original syndesisio/backport-action@v1 also supports dry run of cherry-pick, before the PR is actually merged. To invoke dry run, use atrix strategy (i.e. separate job for each label, assigned to PR). To tell plugin to use branch from a matrix scope, instead of iterating over labels, use BACKPORT_LABEL environment variable:

name: Backport

on:
  pull_request:
    types:
      - closed
      - labeled
      - unlabeled

jobs:
  backport:
    if: ${{ github.event.pull_request.labels != '[]' && github.event.pull_request.labels != '' }}
    strategy:
      matrix:
        label: ${{github.event.pull_request.labels.*.name}}
      fail-fast: false
    runs-on: ubuntu-latest
    steps:
    - name: ${{ matrix.label }}
      env:
        BACKPORT_LABEL: ${{ matrix.label }}
        BACKPORT_REPORT_FAILURE: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
      uses: Cray-HPE/backport-action@v2

About

GitHub Action to backport pull requests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 99.7%
  • Makefile 0.3%