-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
action.yml
32 lines (31 loc) · 1.06 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
name: 'Enable Pull Request Automerge'
description: 'A GitHub action to enable auto-merge on a pull request'
inputs:
token:
description: 'GITHUB_TOKEN or a `repo` scoped Personal Access Token (PAT)'
default: ${{ github.token }}
repository:
description: 'The target GitHub repository containing the pull request'
default: ${{ github.repository }}
pull-request-number:
description: 'The number of the target pull request'
required: true
merge-method:
description: 'The merge method to use. `merge`, `rebase` or `squash`.'
default: merge
runs:
using: composite
steps:
- name: Lowercase
id: lowercase
shell: bash
run: |
echo merge-method=$(echo "${{ inputs.merge-method }}" | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
- name: Enable automerge
shell: bash
run: gh pr merge -R "${{ inputs.repository }}" --${{ steps.lowercase.outputs.merge-method }} --auto "${{ inputs.pull-request-number }}"
env:
GH_TOKEN: ${{ inputs.token }}
branding:
icon: 'git-pull-request'
color: 'gray-dark'