Skip to content

Commit bf5ef80

Browse files
committed
Add ability to stash and rebase in addition to merge
1 parent 6dab34d commit bf5ef80

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ inputs:
1010
cwd:
1111
description: 'The path to the root folder where it should look for code owners'
1212
default: ''
13+
merge_method:
14+
description: "The merge strategy to use: 'merge', 'squash' or 'rebase'"
15+
default: 'merge'
1316

1417
runs:
1518
using: 'node12'

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ async function mergeIfLGTMAndHasAccess() {
139139

140140
core.info(`Creating comments and merging`)
141141
try {
142-
await octokit.pulls.merge({ ...thisRepo, pull_number: issue.number });
142+
// @ts-ignore
143+
await octokit.pulls.merge({ ...thisRepo, pull_number: issue.number, merge_method: core.getInput('merge_method') || 'merge' });
143144
await octokit.issues.createComment({ ...thisRepo, issue_number: issue.number, body: `Merging because @${sender} is a code-owner of all the changes - thanks!` });
144145
} catch (error) {
145146
await octokit.issues.createComment({ ...thisRepo, issue_number: issue.number, body: `There was an issue merging, maybe try again ${sender}.` });

0 commit comments

Comments
 (0)