Skip to content

Commit

Permalink
fix merge_method
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Jun 11, 2024
1 parent 90fff02 commit 2b1af84
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
14 changes: 13 additions & 1 deletion lib/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ async function run() {
await octokit.rest.pulls.createReview({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pr.data.number, event: "APPROVE" });
}
if(autoMerge) {
if (mergeMethod == "merge") {
await octokit.rest.pulls.merge({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pr.data.number, merge_method: "merge" });
} else if (mergeMethod == "rebase") {
await octokit.rest.pulls.merge({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pr.data.number, merge_method: "rebase" });
} else if (mergeMethod == "squash") {
await octokit.rest.pulls.merge({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pr.data.number, merge_method: "squash" });
} else {
core.setFailed(`Unknown merge_method: ${mergeMethod}`);
return;
}
}
} catch (error: any) {
if (error?.request?.request?.retryCount) {
Expand Down

0 comments on commit 2b1af84

Please sign in to comment.