From 800b89a7893fbf3766a2e8377cd9ddbd6c858425 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Wed, 29 Nov 2023 14:01:33 -0800 Subject: [PATCH] fix(repo): using js-yaml load function instead of safeLoad --- scripts/test-github-actions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/test-github-actions.js b/scripts/test-github-actions.js index d6523d5f498..dd0692de846 100755 --- a/scripts/test-github-actions.js +++ b/scripts/test-github-actions.js @@ -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) { @@ -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; }