Skip to content
Permalink
Browse files
fix: don't add awaiting review if the PR is draft.
  • Loading branch information
plainheart committed Mar 29, 2021
1 parent c186fc8 commit c1f4c098c3fb07de095be9731e1b45c1f451da74
Showing 1 changed file with 4 additions and 5 deletions.
@@ -190,15 +190,14 @@ module.exports = (app) => {
});

app.on(['pull_request.synchronize'], async context => {
let addLabel;
const removeLabel = getRemoveLabel(context, 'PR: revision needed');
if (!context.payload.pull_request.draft) {
addLabel = context.octokit.issues.addLabels(
const addLabel = context.payload.pull_request.draft
? Promise.resolve()
: context.octokit.issues.addLabels(
context.issue({
labels: ['PR: awaiting review']
})
);
}
);
return Promise.all([removeLabel, addLabel]);
});

0 comments on commit c1f4c09

Please sign in to comment.