Skip to content

Commit 716db4a

Browse files
committed
cleanup: Removes JSON array parsing.
JSON is a subset of YAML, making it redundant.
1 parent 51b3638 commit 716db4a

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

lib/index.js

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

src/util.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,11 @@ export function matchGitArgs(string: string) {
7070
}
7171

7272
/**
73-
* Tries to parse a JSON array, then a YAML array.
74-
* If both fail, it returns an array containing the input value as its only element
73+
* Tries to parse a YAML sequence (which can be a JSON array).
74+
* If it fails, it returns an array containing the input value as its only element.
7575
*/
7676
export function parseInputArray(input: string): string[] {
7777
core.debug(`Parsing input array: ${input}`);
78-
try {
79-
const json = JSON.parse(input);
80-
if (json && Array.isArray(json) && json.every(e => typeof e === 'string')) {
81-
core.debug(`Input parsed as JSON array of length ${json.length}`);
82-
return json;
83-
}
84-
} catch {} // eslint-disable-line no-empty
85-
8678
try {
8779
const yaml = YAML.load(input);
8880
if (yaml && Array.isArray(yaml) && yaml.every(e => typeof e === 'string')) {

0 commit comments

Comments
 (0)