-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
67 lines (63 loc) · 2.06 KB
/
action.yaml
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
name: "AutomergePR"
author: "Runtime Verification Inc"
branding:
icon: "git-merge"
color: "blue"
description: "Merge tracked PR w/ met requirements All Checks Pass, Review Approved,and Up-to-date."
inputs:
org:
description: 'Organization name under which to run on'
required: true
repo:
description: 'Repository name under Organization'
required: true
token:
description: 'Access token to be able to write to the repository'
required: true
debug:
description: 'Debug mode'
required: false
default: ''
comment:
description: 'Use Predefined comment'
required: false
default: 'false'
outputs:
merged:
value: ${{ steps.automerge.outputs.merged }}
description: 'Whether or not the PR was merged'
error:
value: ${{ steps.automerge.outputs.error }}
description: 'Error message if the PR was not merged'
success:
value: ${{ steps.automerge.outputs.success }}
description: 'Success message if the PR was merged'
runs:
using: 'composite'
steps:
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.10.12'
- name: Install dependencies
shell: bash {0}
run: pip install logging PyGithub argparse
- name: 'Check out repo: ${{ inputs.org }}/${{ inputs.repo }}'
uses: actions/checkout@v4
with:
token: ${{ inputs.token }}
repository: ${{ inputs.org }}/${{ inputs.repo }}
path: tmp-${{ inputs.repo }}
fetch-depth: 0
- name: 'Run automerger: ${{ inputs.org }}/${{ inputs.repo }}'
shell: bash {0}
env:
GITHUB_TOKEN: ${{ inputs.token }}
comment: ${{ inputs.comment }}
working-directory: tmp-${{ inputs.repo }}
run: |
if ${comment} == 'true'; then
python3 ${{ github.action_path }}/src/automerge.py --org ${{ inputs.org }} --repo ${{ inputs.repo }} --comment ${{ inputs.debug }}
else
python3 ${{ github.action_path }}/src/automerge.py --org ${{ inputs.org }} --repo ${{ inputs.repo }} ${{ inputs.debug }}
fi