Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: ignore clean-up errors
Signed-off-by: Amin Yahyaabadi <[email protected]>
  • Loading branch information
aminya committed Apr 2, 2024
commit f182ab14e9fdf4658726b8e555efdf50e3aad183
14 changes: 10 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/inject-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs/promises';
import path from 'path';
import { Opts, getCacheMap } from './opts.js';
import { run } from './run.js';
import { notice } from '@actions/core';

async function injectCache(cacheSource: string, cacheTarget: string, scratchDir: string) {
// Clean Scratch Directory
Expand Down Expand Up @@ -30,7 +31,12 @@ RUN --mount=type=cache,target=${cacheTarget} \
await run('docker', ['buildx', 'build', '-f', path.join(scratchDir, 'Dancefile.inject'), '--tag', 'dance:inject', cacheSource]);

// Clean Directories
await fs.rm(cacheSource, { recursive: true, force: true });
try {
await fs.rm(cacheSource, { recursive: true, force: true });
} catch (err) {
// Ignore Cleaning Errors
notice(`Error while cleaning cache source directory: ${err}. Ignoring...`);
}
}


Expand Down