From 285075f95f91cac25c0ee4f3e726e64c5d1cffc2 Mon Sep 17 00:00:00 2001 From: Okan Sahin <39759830+mokimo@users.noreply.github.com> Date: Fri, 17 May 2024 13:30:16 +0200 Subject: [PATCH] [Github Workflow] Improve zero impact workflow logging (#2330) Improvements for the zero impact PR workflow --- .github/workflows/label-zero-impact.js | 43 +++++++++++--------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/label-zero-impact.js b/.github/workflows/label-zero-impact.js index b956f27952..0a6824910b 100644 --- a/.github/workflows/label-zero-impact.js +++ b/.github/workflows/label-zero-impact.js @@ -33,34 +33,27 @@ const main = async ({ github, context }) => { console.log(`PR ${number} is zero impact: ${isZeroImpactPR}.`); if (isZeroImpactPR) { console.log('Adding zero-impact label to PR.'); - await github.rest.issues - .addLabels({ - owner, - repo, - issue_number: number, - labels: [zeroImpactLabel], - }) - .catch((e) => console.log(e)); + await github.rest.issues.addLabels({ + owner, + repo, + issue_number: number, + labels: [zeroImpactLabel], + }); } else { console.log('Removing zero-impact label from PR.'); - await github.rest.issues - .removeLabel({ - owner, - repo, - issue_number: number, - name: zeroImpactLabel, - }) - .catch((e) => console.log(e)); - + await github.rest.issues.removeLabel({ + owner, + repo, + issue_number: number, + name: zeroImpactLabel, + }); console.log('Posting a comment on the PR.'); - await github.rest.issues - .createComment({ - owner, - repo, - issue_number: number, - body: 'This PR does not qualify for the zero-impact label as it touches code outside of the allowed areas. The label is auto applied, do not manually apply the label.', - }) - .catch((e) => console.log(e)); + await github.rest.issues.createComment({ + owner, + repo, + issue_number: number, + body: 'This PR does not qualify for the zero-impact label as it touches code outside of the allowed areas. The label is auto applied, do not manually apply the label.', + }); } console.log('Process successfully executed.');