Use stdin for files to query attributes of

This commit is contained in:
Michael B. Gale
2026-01-19 13:18:48 +00:00
parent 1782089bde
commit 02b2c55c51
11 changed files with 38 additions and 23 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
import * as os from "os";
import * as core from "@actions/core";
import { ExecOptions } from "@actions/exec";
import * as toolrunner from "@actions/exec/lib/toolrunner";
import * as io from "@actions/io";
import * as semver from "semver";
@@ -62,6 +63,7 @@ export const runGitCommand = async function (
workingDirectory: string | undefined,
args: string[],
customErrorMessage: string,
options?: ExecOptions,
): Promise<string> {
let stdout = "";
let stderr = "";
@@ -78,6 +80,7 @@ export const runGitCommand = async function (
},
},
cwd: workingDirectory,
...options,
}).exec();
return stdout;
} catch (error) {
@@ -412,8 +415,9 @@ export async function getGeneratedFiles(
const files = await listFiles(workingDirectory);
const stdout = await runGitCommand(
workingDirectory,
["check-attr", "linguist-generated", "--", ...files],
["check-attr", "linguist-generated", "--stdin"],
"Unable to check attributes of files.",
{ input: Buffer.from(files.join(" ")) },
);
const generatedFiles: string[] = [];