diff --git a/dist/restore/index.js b/dist/restore/index.js index eebd8a5..b888c6a 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -67272,6 +67272,13 @@ async function cleanBin(oldBins) { } } async function cleanRegistry(packages, crates = true) { + // remove `.cargo/credentials.toml` + try { + const credentials = path.join(CARGO_HOME, ".cargo", "credentials.toml"); + core.debug(`deleting "${credentials}"`); + await fs.promises.unlink(credentials); + } + catch { } // `.cargo/registry/index` let pkgSet = new Set(packages.map((p) => p.name)); const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index")); diff --git a/dist/save/index.js b/dist/save/index.js index 306cf3a..8a1e3e9 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -67272,6 +67272,13 @@ async function cleanBin(oldBins) { } } async function cleanRegistry(packages, crates = true) { + // remove `.cargo/credentials.toml` + try { + const credentials = external_path_default().join(CARGO_HOME, ".cargo", "credentials.toml"); + core.debug(`deleting "${credentials}"`); + await external_fs_default().promises.unlink(credentials); + } + catch { } // `.cargo/registry/index` let pkgSet = new Set(packages.map((p) => p.name)); const indexDir = await external_fs_default().promises.opendir(external_path_default().join(CARGO_HOME, "registry", "index")); diff --git a/src/cleanup.ts b/src/cleanup.ts index 6f7327c..6b401f3 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -91,6 +91,13 @@ export async function cleanBin(oldBins: Array) { } export async function cleanRegistry(packages: Packages, crates = true) { + // remove `.cargo/credentials.toml` + try { + const credentials = path.join(CARGO_HOME, ".cargo", "credentials.toml"); + core.debug(`deleting "${credentials}"`); + await fs.promises.unlink(credentials); + } catch {} + // `.cargo/registry/index` let pkgSet = new Set(packages.map((p) => p.name)); const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));