-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
62 lines (62 loc) · 1.76 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
51
52
53
54
55
56
57
58
59
60
61
62
name: 'Stage, commit, and push'
description: 'Stage, commit, and push to GitHub repositories from GitHub actions.'
branding:
icon: 'arrow-up-circle'
color: 'blue'
inputs:
message:
description: 'Commit message'
required: true
author:
description: 'Commit author'
required: false
default: '"${GITHUB_ACTOR}"'
email:
description: 'Committer email'
required: false
default: '"${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"'
rebase:
description: 'Pull rebase config'
required: false
default: false
fast-forward:
description: 'Pull fast-forward config'
required: false
default: true
branch:
description: 'Git branch'
required: false
default: '"${GITHUB_REF_NAME}"'
files:
description: 'Files to push'
required: false
default: '.'
allow-empty:
description: 'Allow empty commits to be pushed'
required: false
default: false
runs:
using: 'composite'
steps:
- name: 'Configure the runner'
run: |
git config user.name ${{ inputs.author }}
git config user.email ${{ inputs.email }}
shell: bash
- name: 'Set rebase pull mode'
if: ${{ inputs.rebase }}
run: |
git config pull.rebase true
shell: bash
- name: 'Set fast-forward pull mode'
if: ${{ !inputs.rebase && inputs.fast-forward }}
run: |
git config pull.ff true
shell: bash
- name: 'Commit and push the changed files'
run: |
sudo ${{ github.action_path }}/setup-branch.sh ${{ inputs.branch }}
sudo git stage -A ${{ inputs.files }}
sudo ${{ github.action_path }}/commit.sh "${{ inputs.message }}" ${{ inputs.allow-empty }}
sudo ${{ github.action_path }}/push.sh ${{ inputs.branch }}
shell: bash