Skip to content

Commit

Permalink
fix: Allow boolean values in variables (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
PigeonF authored Jul 26, 2024
1 parent 52b231f commit 9016d6f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Parser {
let value = _value;
if (value === null) value = ""; // variable's values are nullable
assert(
typeof value === "string" || typeof value === "number",
typeof value === "string" || typeof value === "number" || typeof value === "boolean",
chalk`{blueBright ${jobName}} has invalid variables hash of key value pairs. ${key}=${value}`
);
jobData.variables[key] = String(value);
Expand All @@ -148,7 +148,7 @@ export class Parser {
const service = jobData.services[i];
for (const [key, value] of Object.entries(service.variables || {})) {
assert(
typeof value === "string" || typeof value === "number",
typeof value === "string" || typeof value === "number" || typeof value === "boolean",
chalk`{blueBright ${jobName}.services[${i}]} has invalid variables hash of key value pairs. ${key}=${value}`
);
jobData.services[i].variables[key] = String(value);
Expand Down
6 changes: 0 additions & 6 deletions tests/test-cases/invalid-variables-bool/.gitlab-ci.yml

This file was deleted.

This file was deleted.

0 comments on commit 9016d6f

Please sign in to comment.