Skip to content

Commit a9b0386

Browse files
committed
Use js-yaml
1 parent c6157cf commit a9b0386

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

package-lock.json

Lines changed: 11 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"dateformat": "3.x",
1818
"dot-prop": "5.x",
1919
"glob": "7.x",
20+
"js-yaml": "3.x",
2021
"pretty-hrtime": "1.x",
2122
"shelljs": "0.x",
2223
"winston": "3.x",
23-
"yaml": "1.X",
2424
"yargs": "15.x"
2525
},
2626
"pkg": {
@@ -31,6 +31,7 @@
3131
"author": "Mads Jon Nielsen <madsjon@gmail.com>",
3232
"license": "ISC",
3333
"devDependencies": {
34+
"@types/js-yaml": "^3.12.1",
3435
"@types/pretty-hrtime": "1.x",
3536
"@types/shelljs": "0.x",
3637
"@types/yaml": "1.x",

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import c = require("ansi-colors");
22
import * as dotProp from "dot-prop";
33
import fs = require("fs");
44
import * as winston from "winston";
5-
import yaml = require("yaml");
5+
import yaml = require("js-yaml");
66
import yargs = require("yargs");
77
import {Job} from "./job";
88

@@ -30,7 +30,7 @@ if (!fs.existsSync(gitlabCiYmlPath)) {
3030
process.exit(1);
3131
}
3232
const gitlabCiContent = fs.readFileSync(gitlabCiYmlPath, "utf8");
33-
const gitlabCiData = yaml.parse(gitlabCiContent);
33+
const gitlabCiData = yaml.safeLoad(gitlabCiContent);
3434

3535
// Parse .gitlab-local.yml
3636
const gitlabCiLocalYmlPath = `${cwd}/.gitlab-ci.local.yml`;
@@ -39,7 +39,7 @@ if (!fs.existsSync(gitlabCiLocalYmlPath)) {
3939
process.exit(1);
4040
}
4141
const gitlabCiLocalContent = fs.readFileSync(gitlabCiLocalYmlPath, "utf8");
42-
const gitlabLocalData = yaml.parse(gitlabCiLocalContent);
42+
const gitlabLocalData = yaml.safeLoad(gitlabCiLocalContent);
4343

4444
const jobs = new Map<string, Job>();
4545
const stages = new Map<string, Job[]>();

0 commit comments

Comments
 (0)