Skip to content

Commit

Permalink
added await to ocktokit rest methods
Browse files Browse the repository at this point in the history
  • Loading branch information
daniela-cyera committed Aug 30, 2023
1 parent 0fcad9f commit 03b896a
Show file tree
Hide file tree
Showing 3 changed files with 641 additions and 136 deletions.
4 changes: 2 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ function addLabel(pr) {
const auto_merge = pr.auto_merge;
if (auto_merge) {
core.info(`Adding auto-merge label to PR number - ${pr.number}`);
client.rest.issues.addLabels(Object.assign(Object.assign({}, github.context.repo), { issue_number: pr.number, labels: ['auto-merge'] }));
yield client.rest.issues.addLabels(Object.assign(Object.assign({}, github.context.repo), { issue_number: pr.number, labels: ['auto-merge'] }));
}
}
catch (ex) {
Expand All @@ -1981,7 +1981,7 @@ function updateBranch(pr) {
if (auto_merge) {
core.info(`PR number - ${pr_number} auto_merge flag is set. Merging with ${baseBranch}`);
try {
client.rest.pulls.updateBranch(Object.assign(Object.assign({}, github.context.repo), { pull_number: pr.number }));
yield client.rest.pulls.updateBranch(Object.assign(Object.assign({}, github.context.repo), { pull_number: pr.number }));
}
catch (ex) {
core.info(ex);
Expand Down
Loading

0 comments on commit 03b896a

Please sign in to comment.