Do not fail diff informed analyses when analyze is run twice in the same job
This commit is contained in:
parent
018ac1a585
commit
083772aae4
3 changed files with 14 additions and 3 deletions
7
lib/analyze.js
generated
7
lib/analyze.js
generated
|
|
@ -343,7 +343,12 @@ function writeDiffRangeDataExtensionPack(logger, ranges) {
|
||||||
ranges = [{ path: "", startLine: 0, endLine: 0 }];
|
ranges = [{ path: "", startLine: 0, endLine: 0 }];
|
||||||
}
|
}
|
||||||
const diffRangeDir = path.join(actionsUtil.getTemporaryDirectory(), "pr-diff-range");
|
const diffRangeDir = path.join(actionsUtil.getTemporaryDirectory(), "pr-diff-range");
|
||||||
fs.mkdirSync(diffRangeDir);
|
// We expect the Actions temporary directory to already exist, so are mainly
|
||||||
|
// using `recursive: true` to avoid errors if the directory already exists,
|
||||||
|
// for example if the analyze Action is run multiple times in the same job.
|
||||||
|
// This is not really something that is supported, but we make use of it in
|
||||||
|
// tests.
|
||||||
|
fs.mkdirSync(diffRangeDir, { recursive: true });
|
||||||
fs.writeFileSync(path.join(diffRangeDir, "qlpack.yml"), `
|
fs.writeFileSync(path.join(diffRangeDir, "qlpack.yml"), `
|
||||||
name: codeql-action/pr-diff-range
|
name: codeql-action/pr-diff-range
|
||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -498,7 +498,13 @@ function writeDiffRangeDataExtensionPack(
|
||||||
actionsUtil.getTemporaryDirectory(),
|
actionsUtil.getTemporaryDirectory(),
|
||||||
"pr-diff-range",
|
"pr-diff-range",
|
||||||
);
|
);
|
||||||
fs.mkdirSync(diffRangeDir);
|
|
||||||
|
// We expect the Actions temporary directory to already exist, so are mainly
|
||||||
|
// using `recursive: true` to avoid errors if the directory already exists,
|
||||||
|
// for example if the analyze Action is run multiple times in the same job.
|
||||||
|
// This is not really something that is supported, but we make use of it in
|
||||||
|
// tests.
|
||||||
|
fs.mkdirSync(diffRangeDir, { recursive: true });
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(diffRangeDir, "qlpack.yml"),
|
path.join(diffRangeDir, "qlpack.yml"),
|
||||||
`
|
`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue