From 35834c12e07e63c3e2bf228ded724b27f3286ef3 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Sat, 19 Aug 2023 19:58:00 -0500 Subject: [PATCH] Automation: Only attach #g-ceo label if not draft (#13383) Why? So it doesn't show up in the #g-ceo board until it's time to review it --- website/api/controllers/webhooks/receive-from-github.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/api/controllers/webhooks/receive-from-github.js b/website/api/controllers/webhooks/receive-from-github.js index e35b129ef6..e66d6811c8 100644 --- a/website/api/controllers/webhooks/receive-from-github.js +++ b/website/api/controllers/webhooks/receive-from-github.js @@ -410,13 +410,13 @@ module.exports = { // Add the appropriate label to PRs awaiting review from the CEO so that these PRs show up in kanban. // [?] https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads?actionType=edited#pull_request - let isPRStillDependentOnCeoReview = expectedReviewers.includes('mikermcneil'); - if (isPRStillDependentOnCeoReview && !existingLabels.includes('#g-ceo')) { + let isPRStillDependentOnAndReadyForCeoReview = expectedReviewers.includes('mikermcneil') && !issueOrPr.draft; + if (isPRStillDependentOnAndReadyForCeoReview && !existingLabels.includes('#g-ceo')) { // [?] https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue await sails.helpers.http.post(`https://api.github.com/repos/${owner}/${repo}/issues/${prNumber}/labels`, { labels: ['#g-ceo'] }, baseHeaders); - } else if (!isPRStillDependentOnCeoReview && existingLabels.includes('#g-ceo')) { + } else if (!isPRStillDependentOnAndReadyForCeoReview && existingLabels.includes('#g-ceo')) { // [?] https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue await sails.helpers.http.del(`https://api.github.com/repos/${owner}/${repo}/issues/${prNumber}/labels/${encodeURIComponent('#g-ceo')}`, {}, baseHeaders); }//fi