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 7e32485 commit c186fc8f670489c883a4ea6cc3d30b85167b5256
Showing 1 changed file with 9 additions and 6 deletions.
@@ -190,13 +190,16 @@ module.exports = (app) => {
});

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

app.on(['pull_request.closed'], async context => {

0 comments on commit c186fc8

Please sign in to comment.