mirror of
https://github.com/github/codeql-action.git
synced 2026-05-22 05:18:35 +00:00
Improve replaces-base validation and add tests
This commit is contained in:
+6
-2
@@ -350,8 +350,12 @@ export function getCredentials(
|
||||
// Construct the base credential object.
|
||||
const baseCredential: Omit<Registry, keyof Address> = { type: e.type };
|
||||
|
||||
if (isDefined(e["replaces-base"])) {
|
||||
if (typeof e["replaces-base"] === "boolean") {
|
||||
// If "replaces-base" is present, it must be a boolean.
|
||||
if ("replaces-base" in e) {
|
||||
if (
|
||||
isDefined(e["replaces-base"]) &&
|
||||
typeof e["replaces-base"] === "boolean"
|
||||
) {
|
||||
baseCredential["replaces-base"] = e["replaces-base"];
|
||||
} else {
|
||||
throw new ConfigurationError(
|
||||
|
||||
Reference in New Issue
Block a user