fix: don't add `awaiting review` if the PR is draft.
diff --git a/index.js b/index.js
index 5ba0e4a..a95a582 100644
--- a/index.js
+++ b/index.js
@@ -190,15 +190,14 @@
});
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]);
});