-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
50 lines (50 loc) · 1.46 KB
/
action.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
40
41
42
43
44
45
46
47
48
49
50
name: "Merge Into Current Branch"
description: "Synchronise branches using Git merge with a (recursive) strategy"
branding:
icon: "git-merge"
color: "blue"
inputs:
from:
description: "Branch to merge into the current branch"
required: true
commit:
description: "Commit changes?"
default: "true"
required: true
author:
description: "Commit author in Git author format"
default: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
required: true
strategy:
description: "Merge strategy with any strategy options"
default: "recursive -Xtheirs"
required: true
push:
description: "Push commit to origin?"
default: "true"
required: true
runs:
using: "composite"
steps:
- name: Set commit author information
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Merge ${{ inputs.from }} with ${{ inputs.strategy }} strategy
shell: bash
run: |
MERGE="git merge ${{ inputs.from }} -s ${{ inputs.strategy }}"
if [ "${{ inputs.commit }}" == "true" ]
then
eval $MERGE --commit
else
eval $MERGE --no-commit
fi
- name: "Push changes from ${{ inputs.from }} to origin"
shell: bash
run: |
if [ "${{ inputs.push }}" == "true" ]
then
git push origin HEAD
fi