-
Notifications
You must be signed in to change notification settings - Fork 14
39 lines (37 loc) · 1.36 KB
/
bflat-backport.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
35
36
37
38
39
name: Backport a commit
on:
workflow_dispatch:
inputs:
branch:
description: 'Destination branch (ex: bflat-release/7.0)'
required: true
commit:
description: 'Commit hash'
required: true
jobs:
backport:
if: ${{ github.actor == 'MichalStrehovsky' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: '${{ github.event.inputs.branch }}'
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Create branch
run: git checkout -b backport-${{ github.event.inputs.branch }}-${{ github.event.inputs.commit }}
- name: Cherry pick commit
run: git cherry-pick ${{ github.event.inputs.commit }}
- name: Push
run: git push --force --set-upstream origin HEAD:backport-${{ github.event.inputs.branch }}-${{ github.event.inputs.commit }}
- name: Create pull request
uses: ./bflat/actions/pullrequest
with:
auth_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: backport-${{ github.event.inputs.branch }}-${{ github.event.inputs.commit }}
target_branch: ${{ github.event.inputs.branch }}
pr_title: '[${{ github.event.inputs.branch }}] Backport of ${{ github.event.inputs.commit }}'