From eb0eca97645612cf5958ad1977616cb9ce8d775e Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 10 Oct 2022 17:09:33 +0000 Subject: [PATCH] fixup! feat(github-actions): introduce action to identify PRs affecting Google Address feedback --- .../google-internal-tests/lib/main.ts | 32 ++++++++----------- github-actions/google-internal-tests/main.js | 14 ++++---- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/github-actions/google-internal-tests/lib/main.ts b/github-actions/google-internal-tests/lib/main.ts index f4489d849..431f6387a 100644 --- a/github-actions/google-internal-tests/lib/main.ts +++ b/github-actions/google-internal-tests/lib/main.ts @@ -37,28 +37,24 @@ async function main() { } } - const status = affectsGoogle - ? ({ - state: 'pending', - // The initial waiting status is expected to be overridden by the - // internal presubmit status service then. - description: `Waiting for Google Internal Tests. ${ - runTestGuideURL ? `@Googlers: See Details for instructions -->` : '' - }`.trim(), - url: runTestGuideURL, - } as const) - : ({ - state: 'success', - description: 'Does not affect Google.', - } as const); + const waitingForG3Status = { + state: 'pending' as const, + // The initial waiting status is expected to be overridden by the + // internal presubmit status service then. + description: `Waiting for Google Internal Tests. ${ + runTestGuideURL ? `@Googlers: See Details for instructions -->` : '' + }`.trim(), + target_url: runTestGuideURL, + }; + const irrelevantToG3Status = { + state: 'success' as const, + description: 'Does not affect Google.', + }; await github.repos.createCommitStatus({ ...context.repo, + ...(affectsGoogle ? waitingForG3Status : irrelevantToG3Status), sha: prHeadSHA, - state: status.state, - description: status.description, - context: 'google-internal-tests', - target_url: status.url, }); } diff --git a/github-actions/google-internal-tests/main.js b/github-actions/google-internal-tests/main.js index 6fe3e0d68..da109e1b6 100644 --- a/github-actions/google-internal-tests/main.js +++ b/github-actions/google-internal-tests/main.js @@ -16600,21 +16600,19 @@ async function main() { break; } } - const status = affectsGoogle ? { + const waitingForG3Status = { state: "pending", description: `Waiting for Google Internal Tests. ${runTestGuideURL ? `@Googlers: See Details for instructions -->` : ""}`.trim(), - url: runTestGuideURL - } : { + target_url: runTestGuideURL + }; + const irrelevantToG3Status = { state: "success", description: "Does not affect Google." }; await github.repos.createCommitStatus({ ...import_github.context.repo, - sha: prHeadSHA, - state: status.state, - description: status.description, - context: "google-internal-tests", - target_url: status.url + ...affectsGoogle ? waitingForG3Status : irrelevantToG3Status, + sha: prHeadSHA }); } function constructPatterns(rawPatterns) {