From ca7f194e36e134047efb7d19b419c1f1dff3059f Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Mon, 6 May 2024 15:26:55 -0700 Subject: [PATCH] Avoid warning on workflow_call triggers Typically, we warn when there is no `push` trigger in the workflow file that triggered this run. However, when this action is triggered by a `workflow_call` event, we assume there is a custom process for triggering the action and we don't want to warn in this case. --- CHANGELOG.md | 3 ++- lib/workflow.js | 47 ++++++++++++++++-------------------- lib/workflow.js.map | 2 +- lib/workflow.test.js | 23 ++++++++++++++++++ lib/workflow.test.js.map | 2 +- src/workflow.test.ts | 38 +++++++++++++++++++++++++++++ src/workflow.ts | 52 ++++++++++++++++++---------------------- 7 files changed, 108 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d14b75b9..769c9f14fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the ## [UNRELEASED] - Update default CodeQL bundle version to 2.17.2. [#2270](https://github.com/github/codeql-action/pull/2270) +- Avoid printing out a warning for a missing `on.push` trigger when the CodeQL Action is triggered via a `workflow_call` event. [#2274](https://github.com/github/codeql-action/pull/2274) ## 3.25.3 - 25 Apr 2024 @@ -30,7 +31,7 @@ No user facing changes. - The `setup-python-dependencies` input to the `init` Action - The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable - + We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0. - Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229) - Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232) diff --git a/lib/workflow.js b/lib/workflow.js index 9292a4c37b..45bffef0f5 100644 --- a/lib/workflow.js +++ b/lib/workflow.js @@ -35,9 +35,6 @@ const yaml = __importStar(require("js-yaml")); const api = __importStar(require("./api-client")); const environment_1 = require("./environment"); const util_1 = require("./util"); -function isObject(o) { - return o !== null && typeof o === "object"; -} const GLOB_PATTERN = new RegExp("(\\*\\*?)"); function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string @@ -144,35 +141,31 @@ async function getWorkflowErrors(doc, codeql) { } } } - let missingPush = false; - if (doc.on === undefined) { - // this is not a valid config - } - else if (typeof doc.on === "string") { - if (doc.on === "pull_request") { - missingPush = true; - } - } - else if (Array.isArray(doc.on)) { - const hasPush = doc.on.includes("push"); - const hasPullRequest = doc.on.includes("pull_request"); - if (hasPullRequest && !hasPush) { - missingPush = true; - } - } - else if (isObject(doc.on)) { - const hasPush = Object.prototype.hasOwnProperty.call(doc.on, "push"); - const hasPullRequest = Object.prototype.hasOwnProperty.call(doc.on, "pull_request"); - if (!hasPush && hasPullRequest) { - missingPush = true; - } - } - if (missingPush) { + // If there is no push trigger, we will not be able to analyze the default branch. + // So add a warning to the user to add a push trigger. + // If there is a workflow_call trigger, we don't need a push trigger since we assume + // that the workflow_call trigger is called from a workflow that has a push trigger. + const hasPushTrigger = hasWorkflowTrigger("push", doc); + const hasPullRequestTrigger = hasWorkflowTrigger("pull_request", doc); + const hasWorkflowCallTrigger = hasWorkflowTrigger("workflow_call", doc); + if (hasPullRequestTrigger && !hasPushTrigger && !hasWorkflowCallTrigger) { errors.push(exports.WorkflowErrors.MissingPushHook); } return errors; } exports.getWorkflowErrors = getWorkflowErrors; +function hasWorkflowTrigger(triggerName, doc) { + if (!doc.on) { + return false; + } + if (typeof doc.on === "string") { + return doc.on === triggerName; + } + if (Array.isArray(doc.on)) { + return doc.on.includes(triggerName); + } + return Object.prototype.hasOwnProperty.call(doc.on, triggerName); +} async function validateWorkflow(codeql, logger) { let workflow; try { diff --git a/lib/workflow.js.map b/lib/workflow.js.map index fab919974c..3757a73503 100644 --- a/lib/workflow.js.map +++ b/lib/workflow.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],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AC,KAAK,yBAAyB,EACrE,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,8BAA8B,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CACrC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,0DAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,sDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file +{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwB;AAExB,oDAAsC;AACtC,8CAAgC;AAEhC,kDAAoC;AAEpC,+CAAuC;AAEvC,iCAA2D;AAsC3D,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7C,SAAS,YAAY,CAAC,MAAM;IAC1B,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,oCAAoC;AAC5F,CAAC;AAED,SAAS,eAAe,CAAC,KA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,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file diff --git a/lib/workflow.test.js b/lib/workflow.test.js index 6b5f6854af..8657a01440 100644 --- a/lib/workflow.test.js +++ b/lib/workflow.test.js @@ -373,6 +373,29 @@ async function testLanguageAliases(t, matrixLanguages, aliases, expectedErrorMes on: ["push"] `), await (0, codeql_1.getCodeQLForTesting)()), [])); }); +(0, ava_1.default)("getWorkflowErrors() should not report a warning if there is a workflow_call trigger", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` + name: "CodeQL" + on: + workflow_call: + `), await (0, codeql_1.getCodeQLForTesting)()); + t.deepEqual(...errorCodes(errors, [])); +}); +(0, ava_1.default)("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as a string", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` + name: "CodeQL" + on: workflow_call + `), await (0, codeql_1.getCodeQLForTesting)()); + t.deepEqual(...errorCodes(errors, [])); +}); +(0, ava_1.default)("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as an array", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` + name: "CodeQL" + on: + - workflow_call + `), await (0, codeql_1.getCodeQLForTesting)()); + t.deepEqual(...errorCodes(errors, [])); +}); (0, ava_1.default)("getCategoryInputOrThrow returns category for simple workflow with category", (t) => { process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; t.is((0, workflow_1.getCategoryInputOrThrow)(yaml.load(` diff --git a/lib/workflow.test.js.map b/lib/workflow.test.js.map index f28eacb659..1137d0c924 100644 --- a/lib/workflow.test.js.map +++ b/lib/workflow.test.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.test.js","sourceRoot":"","sources":["../src/workflow.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA6C;AAC7C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index 688b34b00f..ec10b43022 100644 --- a/src/workflow.test.ts +++ b/src/workflow.test.ts @@ -643,6 +643,44 @@ test("getWorkflowErrors() should not report an error if PRs are totally unconfig ); }); +test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger", async (t) => { + const errors = await getWorkflowErrors( + yaml.load(` + name: "CodeQL" + on: + workflow_call: + `) as Workflow, + await getCodeQLForTesting(), + ); + + t.deepEqual(...errorCodes(errors, [])); +}); + +test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as a string", async (t) => { + const errors = await getWorkflowErrors( + yaml.load(` + name: "CodeQL" + on: workflow_call + `) as Workflow, + await getCodeQLForTesting(), + ); + + t.deepEqual(...errorCodes(errors, [])); +}); + +test("getWorkflowErrors() should not report a warning if there is a workflow_call trigger as an array", async (t) => { + const errors = await getWorkflowErrors( + yaml.load(` + name: "CodeQL" + on: + - workflow_call + `) as Workflow, + await getCodeQLForTesting(), + ); + + t.deepEqual(...errorCodes(errors, [])); +}); + test("getCategoryInputOrThrow returns category for simple workflow with category", (t) => { process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; t.is( diff --git a/src/workflow.ts b/src/workflow.ts index decd03f64a..645112a3f1 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -47,10 +47,6 @@ export interface Workflow { on?: string | string[] | WorkflowTriggers; } -function isObject(o: unknown): o is object { - return o !== null && typeof o === "object"; -} - const GLOB_PATTERN = new RegExp("(\\*\\*?)"); function escapeRegExp(string) { @@ -193,37 +189,35 @@ export async function getWorkflowErrors( } } - let missingPush = false; + // If there is no push trigger, we will not be able to analyze the default branch. + // So add a warning to the user to add a push trigger. + // If there is a workflow_call trigger, we don't need a push trigger since we assume + // that the workflow_call trigger is called from a workflow that has a push trigger. + const hasPushTrigger = hasWorkflowTrigger("push", doc); + const hasPullRequestTrigger = hasWorkflowTrigger("pull_request", doc); + const hasWorkflowCallTrigger = hasWorkflowTrigger("workflow_call", doc); - if (doc.on === undefined) { - // this is not a valid config - } else if (typeof doc.on === "string") { - if (doc.on === "pull_request") { - missingPush = true; - } - } else if (Array.isArray(doc.on)) { - const hasPush = doc.on.includes("push"); - const hasPullRequest = doc.on.includes("pull_request"); - if (hasPullRequest && !hasPush) { - missingPush = true; - } - } else if (isObject(doc.on)) { - const hasPush = Object.prototype.hasOwnProperty.call(doc.on, "push"); - const hasPullRequest = Object.prototype.hasOwnProperty.call( - doc.on, - "pull_request", - ); + if (hasPullRequestTrigger && !hasPushTrigger && !hasWorkflowCallTrigger) { + errors.push(WorkflowErrors.MissingPushHook); + } - if (!hasPush && hasPullRequest) { - missingPush = true; - } + return errors; +} + +function hasWorkflowTrigger(triggerName: string, doc: Workflow): boolean { + if (!doc.on) { + return false; } - if (missingPush) { - errors.push(WorkflowErrors.MissingPushHook); + if (typeof doc.on === "string") { + return doc.on === triggerName; } - return errors; + if (Array.isArray(doc.on)) { + return doc.on.includes(triggerName); + } + + return Object.prototype.hasOwnProperty.call(doc.on, triggerName); } export async function validateWorkflow(