name: Cherry pick commit(s)

on:
  workflow_dispatch:
    inputs:
      commit:
        description: 'Commit to cherrypick'
        required: true
      branch:
        description: 'Branch to cherry pick to'
        required: true
        default: 'v5-09-XX'
      
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Decide which branch to use
      run: |
        cat << EOF
        ::set-output name=branch::$(echo ${{ github.event.inputs.branch }}-patches | sed -e's/[a-z][a-z]*-patches$/-patches/')
        EOF
      id: decide_release_branch
    - uses: actions/checkout@v2
      with:
        ref: "${{ steps.decide_release_branch.outputs.branch }}"
    - name: Update the branch
      run: |
        set -e
        git checkout ${{ steps.decide_release_branch.outputs.branch }}
        git cherry-pick ${{ github.event.inputs.commit }}
        git config --global user.email "alibuild@cern.ch"
        git config --global user.name "ALICE Action Bot"
        git push

name: Cherry pick commit(s)

on:
  workflow_dispatch:
    inputs:
      commit:
        description: 'Commit to cherrypick'
        required: true
      branch:
        description: 'Branch to cherry pick to'
        required: true
        default: 'v5-09-XX'
      
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Decide which branch to use
      run: |
        cat << EOF
        ::set-output name=branch::$(echo ${{ github.event.inputs.branch }}-patches | sed -e's/[a-z][a-z]*-patches$/-patches/')
        EOF
      id: decide_release_branch
    - uses: actions/checkout@v2
      with:
        ref: "master"
    - uses: actions/checkout@v2
      with:
        ref: "${{ steps.decide_release_branch.outputs.branch }}"
    - name: Update the branch
      run: |
        set -e
        git checkout ${{ steps.decide_release_branch.outputs.branch }}
        git cherry-pick ${{ github.event.inputs.commit }}
        git config --global user.email "alibuild@cern.ch"
        git config --global user.name "ALICE Action Bot"
        git push

Add workflow to do cherrypicks
Add workflow to do cherrypicks
