Skip to content

Commit fcc03cd

Browse files
authored
fix: expand variable when parsing cache path (#1618)
1 parent 17a5f20 commit fcc03cd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/job.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,8 @@ export class Job {
12241224
});
12251225
endTime = process.hrtime(time);
12261226

1227-
for (const _path of c.paths) {
1227+
for (const __path of c.paths) {
1228+
const _path = Utils.expandText(__path, expanded);
12281229
if (!Utils.isSubpath(_path, this.argv.cwd, this.argv.cwd)) {
12291230
writeStreams.stdout(chalk`{yellow WARNING: processPath: artifact path is not a subpath of project directory: ${_path}}\n`);
12301231
continue;

tests/test-cases/cache-directives/integration.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ test.concurrent("cache-directives <test-job> --shell-isolation --needs", async (
1414
await handler({
1515
cwd: "tests/test-cases/cache-directives",
1616
job: ["test-job"],
17+
noColor: true,
1718
shellIsolation: true,
1819
}, writeStreams);
1920

2021
await expect(fs.pathExists("tests/test-cases/cache-directives/.gitlab-ci-local/cache/default/cache/file1.txt")).resolves.toBe(true);
22+
expect(writeStreams.stdoutLines.join("\n")).toContain("cache/**.txt: found 1 artifact files and directories");
2123
});

0 commit comments

Comments
 (0)