forked from sequoia-pgp/fast-forward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
71 lines (63 loc) · 2.15 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
63
64
65
66
67
68
69
70
71
name: 'Fast Forward Merge'
description: 'Merge a pull request by fast forwarding the target branch.'
author: 'Sequoia PGP'
inputs:
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'
merge:
description: >
Whether to actually merge the pull request or only check whether
fast forwarding is possible.
If true, the action will fast forward the target branch, if
possible. If false, the action will only post a comment
indicating whether it is possible to fast forward the target
branch.
default: false
comment:
description: >
Whether to post a comment.
If set to true or always, this posts a comment to the pull
request indicating whether it is possible to fast-forward the
target branch, and, if merge is true, whether fast forwarding
succeeded.
If set to on-error (the default), a comment is only posted if
an error occurs.
If false or never, no comment is posted. The comment is
still available via the comment output variable, and in the
step's summary.
default: on-error
debug:
description: >
Enables debugging output.
If set to 1 or true, increases the workflow's verbosity. This
may also execute some additional RPCs, and so should normally
be disabled.
default: 0
outputs:
comment:
description: >
The comment.
A comment explaining whether fast forwarding is possible, and,
if `merge` is true, whether it was successful.
The comment is a JSON document with a single field, `body`.
value: ${{ steps.fast-forward.outputs.comment }}
runs:
using: "composite"
steps:
- id: fast-forward
run: |
export GITHUB_TOKEN=${{ inputs.github_token }}
export DEBUG=${{ inputs.debug }}
export COMMENT=${{ inputs.comment }}
# github.action_path is set to $REPO.
if test "x${{ inputs.merge }}" = xtrue
then
${{ github.action_path }}/src/fast-forward.sh --merge
else
${{ github.action_path }}/src/fast-forward.sh
fi
shell: bash
branding:
icon: 'arrow-up-right'
color: 'green'