mirror of
https://github.com/github/codeql-action.git
synced 2025-12-20 06:10:20 +08:00
Make getInputOrThrow throw when it can't find any calls to the Action
This created unexpected behavior with a workflow calling `codeql-action/analyze` locally. Therefore, be more conservative with parsing inputs from workflows and refuse to parse jobs that don't call the specified Action exactly once.
This commit is contained in:
6
lib/workflow.test.js
generated
6
lib/workflow.test.js
generated
@@ -435,7 +435,7 @@ function errorCodes(actual, expected) {
|
||||
"an unrecognized dynamic value.",
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("getCategoryInputOrThrow throws error for workflow with multiple categories", (t) => {
|
||||
(0, ava_1.default)("getCategoryInputOrThrow throws error for workflow with multiple calls to analyze", (t) => {
|
||||
t.throws(() => (0, workflow_1.getCategoryInputOrThrow)(yaml.load(`
|
||||
jobs:
|
||||
analysis:
|
||||
@@ -450,8 +450,8 @@ function errorCodes(actual, expected) {
|
||||
with:
|
||||
category: another-category
|
||||
`), "analysis", {}), {
|
||||
message: "Could not get category input to github/codeql-action/analyze since there were multiple steps " +
|
||||
"calling github/codeql-action/analyze with different values for category.",
|
||||
message: "Could not get category input to github/codeql-action/analyze since the analysis job " +
|
||||
"calls github/codeql-action/analyze multiple times.",
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=workflow.test.js.map
|
||||
Reference in New Issue
Block a user