Skip to content

Commit

Permalink
fix(repo): using js-yaml load function instead of safeLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed Nov 29, 2023
1 parent fd11523 commit 800b89a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/test-github-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// SPDX-License-Identifier: Apache-2.0
'use strict';

const glob = require('glob');
const fs = require('fs');

const glob = require('glob');
const yaml = require('js-yaml');

function parseYamlFile(file) {
const fileContents = fs.readFileSync(file, 'utf8');
return yaml.safeLoad(fileContents);

return yaml.load(fileContents);
}

function getKeyValuesFor(targetKey, yamlObject) {
Expand Down Expand Up @@ -62,7 +64,7 @@ for (const file of [...workflowYmlFiles, ...actionYmlFiles]) {
continue;
}
console.log(
`In ${file} the uses reference ${val} must either be local to the project or fully reference a specific action commit on an external project`
`In ${file} the uses reference ${val} must either be local to the project or fully reference a specific action commit on an external project`,
);
exitCode = 1;
}
Expand Down

0 comments on commit 800b89a

Please sign in to comment.