forked from ZupIT/ritchie-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.17 KB
/
generate-patch-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Generate patch branch with Cherry Pick
on:
workflow_dispatch:
inputs:
reference-tag:
description: 'Tag from which we want to create the patch (e.g: 1.2.3)'
required: true
new-tag:
description: 'New tag that will be created (e.g: 1.2.4)'
required: true
commit-hash:
description: 'Commit Hash to add to the reference tag to generate the new tag' # e.g: abc123ce79159e628371a06d3b7e0d757abc123
required: true
jobs:
generate-patch-release-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
- name: Execute Cherry Pick commands
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git fetch -a
git checkout tags/${{ github.event.inputs.reference-tag }} -b release-${{ github.event.inputs.new-tag }}
git cherry-pick ${{ github.event.inputs.commit-hash }} --strategy-option=ours
git push --set-upstream origin release-${{ github.event.inputs.new-tag }}