mirror of
https://github.com/actions/cache.git
synced 2026-07-01 01:21:41 +00:00
Compare commits
9 Commits
a0a285ffd4
...
d0be34d544
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0be34d544 | ||
|
|
66cf064d47 | ||
|
|
e12d46a63a | ||
|
|
1baebfc3ba | ||
|
|
eb94f1a6bf | ||
|
|
e71876755e | ||
|
|
01229828ff | ||
|
|
3185ecfd61 | ||
|
|
25618a0a67 |
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
@ -111,3 +111,12 @@
|
|||||||
### 3.3.2
|
### 3.3.2
|
||||||
|
|
||||||
- Fixes bug with Azure SDK causing blob downloads to get stuck.
|
- Fixes bug with Azure SDK causing blob downloads to get stuck.
|
||||||
|
|
||||||
|
### 3.3.3
|
||||||
|
|
||||||
|
- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)
|
||||||
|
- Additional audit fixes of npm package(s)
|
||||||
|
|
||||||
|
### 4.0.0
|
||||||
|
|
||||||
|
- Updated minimum runner version support from node 12 -> node 20
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import { Events, Inputs, RefKey } from "../src/constants";
|
import { Events, Inputs, RefKey } from "../src/constants";
|
||||||
import run from "../src/save";
|
import { saveRun } from "../src/saveImpl";
|
||||||
import * as actionUtils from "../src/utils/actionUtils";
|
import * as actionUtils from "../src/utils/actionUtils";
|
||||||
import * as testUtils from "../src/utils/testUtils";
|
import * as testUtils from "../src/utils/testUtils";
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ test("save with valid inputs uploads a cache", async () => {
|
|||||||
return Promise.resolve(cacheId);
|
return Promise.resolve(cacheId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run();
|
await saveRun();
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import { Events, Inputs, RefKey } from "../src/constants";
|
import { Events, Inputs, RefKey } from "../src/constants";
|
||||||
import run from "../src/saveImpl";
|
import { saveImpl } from "../src/saveImpl";
|
||||||
import { StateProvider } from "../src/stateProvider";
|
import { StateProvider } from "../src/stateProvider";
|
||||||
import * as actionUtils from "../src/utils/actionUtils";
|
import * as actionUtils from "../src/utils/actionUtils";
|
||||||
import * as testUtils from "../src/utils/testUtils";
|
import * as testUtils from "../src/utils/testUtils";
|
||||||
@ -77,7 +77,7 @@ test("save with invalid event outputs warning", async () => {
|
|||||||
const invalidEvent = "commit_comment";
|
const invalidEvent = "commit_comment";
|
||||||
process.env[Events.Key] = invalidEvent;
|
process.env[Events.Key] = invalidEvent;
|
||||||
delete process.env[RefKey];
|
delete process.env[RefKey];
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
`Event Validation Error: The event type ${invalidEvent} is not supported because it's not tied to a branch or tag ref.`
|
`Event Validation Error: The event type ${invalidEvent} is not supported because it's not tied to a branch or tag ref.`
|
||||||
);
|
);
|
||||||
@ -100,7 +100,7 @@ test("save with no primary key in state outputs warning", async () => {
|
|||||||
});
|
});
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(`Key is not specified.`);
|
expect(logWarningMock).toHaveBeenCalledWith(`Key is not specified.`);
|
||||||
@ -115,7 +115,7 @@ test("save without AC available should no-op", async () => {
|
|||||||
|
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
});
|
});
|
||||||
@ -128,7 +128,7 @@ test("save on ghes without AC available should no-op", async () => {
|
|||||||
|
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
});
|
});
|
||||||
@ -161,7 +161,7 @@ test("save on GHES with AC available", async () => {
|
|||||||
return Promise.resolve(cacheId);
|
return Promise.resolve(cacheId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
@ -194,7 +194,7 @@ test("save with exact match returns early", async () => {
|
|||||||
});
|
});
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
@ -221,7 +221,7 @@ test("save with missing input outputs warning", async () => {
|
|||||||
});
|
});
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
@ -259,7 +259,7 @@ test("save with large cache outputs warning", async () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
@ -306,7 +306,7 @@ test("save with reserve cache failure outputs warning", async () => {
|
|||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
@ -349,7 +349,7 @@ test("save with server error outputs warning", async () => {
|
|||||||
throw new Error("HTTP Error Occurred");
|
throw new Error("HTTP Error Occurred");
|
||||||
});
|
});
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
@ -392,7 +392,7 @@ test("save with valid inputs uploads a cache", async () => {
|
|||||||
return Promise.resolve(cacheId);
|
return Promise.resolve(cacheId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run(new StateProvider());
|
await saveImpl(new StateProvider());
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import { Events, Inputs, RefKey } from "../src/constants";
|
import { Events, Inputs, RefKey } from "../src/constants";
|
||||||
import run from "../src/saveOnly";
|
import { saveOnlyRun } from "../src/saveImpl";
|
||||||
import * as actionUtils from "../src/utils/actionUtils";
|
import * as actionUtils from "../src/utils/actionUtils";
|
||||||
import * as testUtils from "../src/utils/testUtils";
|
import * as testUtils from "../src/utils/testUtils";
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ test("save with valid inputs uploads a cache", async () => {
|
|||||||
return Promise.resolve(cacheId);
|
return Promise.resolve(cacheId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run();
|
await saveOnlyRun();
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
@ -122,7 +122,7 @@ test("save failing logs the warning message", async () => {
|
|||||||
return Promise.resolve(cacheId);
|
return Promise.resolve(cacheId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await run();
|
await saveOnlyRun();
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
expect(saveCacheMock).toHaveBeenCalledTimes(1);
|
||||||
expect(saveCacheMock).toHaveBeenCalledWith(
|
expect(saveCacheMock).toHaveBeenCalledWith(
|
||||||
|
|||||||
38
dist/restore-only/index.js
vendored
38
dist/restore-only/index.js
vendored
@ -319,7 +319,8 @@ function createHttpClient() {
|
|||||||
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
||||||
}
|
}
|
||||||
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
||||||
const components = paths;
|
// don't pass changes upstream
|
||||||
|
const components = paths.slice();
|
||||||
// Add compression method to cache version to restore
|
// Add compression method to cache version to restore
|
||||||
// compressed cache as per compression method
|
// compressed cache as per compression method
|
||||||
if (compressionMethod) {
|
if (compressionMethod) {
|
||||||
@ -608,26 +609,21 @@ function resolvePaths(patterns) {
|
|||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
||||||
_c = _g.value;
|
_c = _g.value;
|
||||||
_e = false;
|
_e = false;
|
||||||
try {
|
const file = _c;
|
||||||
const file = _c;
|
const relativeFile = path
|
||||||
const relativeFile = path
|
.relative(workspace, file)
|
||||||
.relative(workspace, file)
|
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
||||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
core.debug(`Matched: ${relativeFile}`);
|
||||||
core.debug(`Matched: ${relativeFile}`);
|
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
if (relativeFile === '') {
|
||||||
if (relativeFile === '') {
|
// path.relative returns empty string if workspace and file are equal
|
||||||
// path.relative returns empty string if workspace and file are equal
|
paths.push('.');
|
||||||
paths.push('.');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
paths.push(`${relativeFile}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally {
|
else {
|
||||||
_e = true;
|
paths.push(`${relativeFile}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -729,7 +725,7 @@ var CacheFilename;
|
|||||||
(function (CacheFilename) {
|
(function (CacheFilename) {
|
||||||
CacheFilename["Gzip"] = "cache.tgz";
|
CacheFilename["Gzip"] = "cache.tgz";
|
||||||
CacheFilename["Zstd"] = "cache.tzst";
|
CacheFilename["Zstd"] = "cache.tzst";
|
||||||
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
|
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
|
||||||
var CompressionMethod;
|
var CompressionMethod;
|
||||||
(function (CompressionMethod) {
|
(function (CompressionMethod) {
|
||||||
CompressionMethod["Gzip"] = "gzip";
|
CompressionMethod["Gzip"] = "gzip";
|
||||||
@ -737,12 +733,12 @@ var CompressionMethod;
|
|||||||
// This enum is for earlier version of zstd that does not have --long support
|
// This enum is for earlier version of zstd that does not have --long support
|
||||||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||||
CompressionMethod["Zstd"] = "zstd";
|
CompressionMethod["Zstd"] = "zstd";
|
||||||
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
|
||||||
var ArchiveToolType;
|
var ArchiveToolType;
|
||||||
(function (ArchiveToolType) {
|
(function (ArchiveToolType) {
|
||||||
ArchiveToolType["GNU"] = "gnu";
|
ArchiveToolType["GNU"] = "gnu";
|
||||||
ArchiveToolType["BSD"] = "bsd";
|
ArchiveToolType["BSD"] = "bsd";
|
||||||
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
|
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
|
||||||
// The default number of retry attempts.
|
// The default number of retry attempts.
|
||||||
exports.DefaultRetryAttempts = 2;
|
exports.DefaultRetryAttempts = 2;
|
||||||
// The default delay in milliseconds between retry attempts.
|
// The default delay in milliseconds between retry attempts.
|
||||||
|
|||||||
38
dist/restore/index.js
vendored
38
dist/restore/index.js
vendored
@ -319,7 +319,8 @@ function createHttpClient() {
|
|||||||
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
||||||
}
|
}
|
||||||
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
||||||
const components = paths;
|
// don't pass changes upstream
|
||||||
|
const components = paths.slice();
|
||||||
// Add compression method to cache version to restore
|
// Add compression method to cache version to restore
|
||||||
// compressed cache as per compression method
|
// compressed cache as per compression method
|
||||||
if (compressionMethod) {
|
if (compressionMethod) {
|
||||||
@ -608,26 +609,21 @@ function resolvePaths(patterns) {
|
|||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
||||||
_c = _g.value;
|
_c = _g.value;
|
||||||
_e = false;
|
_e = false;
|
||||||
try {
|
const file = _c;
|
||||||
const file = _c;
|
const relativeFile = path
|
||||||
const relativeFile = path
|
.relative(workspace, file)
|
||||||
.relative(workspace, file)
|
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
||||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
core.debug(`Matched: ${relativeFile}`);
|
||||||
core.debug(`Matched: ${relativeFile}`);
|
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
if (relativeFile === '') {
|
||||||
if (relativeFile === '') {
|
// path.relative returns empty string if workspace and file are equal
|
||||||
// path.relative returns empty string if workspace and file are equal
|
paths.push('.');
|
||||||
paths.push('.');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
paths.push(`${relativeFile}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally {
|
else {
|
||||||
_e = true;
|
paths.push(`${relativeFile}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -729,7 +725,7 @@ var CacheFilename;
|
|||||||
(function (CacheFilename) {
|
(function (CacheFilename) {
|
||||||
CacheFilename["Gzip"] = "cache.tgz";
|
CacheFilename["Gzip"] = "cache.tgz";
|
||||||
CacheFilename["Zstd"] = "cache.tzst";
|
CacheFilename["Zstd"] = "cache.tzst";
|
||||||
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
|
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
|
||||||
var CompressionMethod;
|
var CompressionMethod;
|
||||||
(function (CompressionMethod) {
|
(function (CompressionMethod) {
|
||||||
CompressionMethod["Gzip"] = "gzip";
|
CompressionMethod["Gzip"] = "gzip";
|
||||||
@ -737,12 +733,12 @@ var CompressionMethod;
|
|||||||
// This enum is for earlier version of zstd that does not have --long support
|
// This enum is for earlier version of zstd that does not have --long support
|
||||||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||||
CompressionMethod["Zstd"] = "zstd";
|
CompressionMethod["Zstd"] = "zstd";
|
||||||
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
|
||||||
var ArchiveToolType;
|
var ArchiveToolType;
|
||||||
(function (ArchiveToolType) {
|
(function (ArchiveToolType) {
|
||||||
ArchiveToolType["GNU"] = "gnu";
|
ArchiveToolType["GNU"] = "gnu";
|
||||||
ArchiveToolType["BSD"] = "bsd";
|
ArchiveToolType["BSD"] = "bsd";
|
||||||
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
|
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
|
||||||
// The default number of retry attempts.
|
// The default number of retry attempts.
|
||||||
exports.DefaultRetryAttempts = 2;
|
exports.DefaultRetryAttempts = 2;
|
||||||
// The default delay in milliseconds between retry attempts.
|
// The default delay in milliseconds between retry attempts.
|
||||||
|
|||||||
159
dist/save-only/index.js
vendored
159
dist/save-only/index.js
vendored
@ -319,7 +319,8 @@ function createHttpClient() {
|
|||||||
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
||||||
}
|
}
|
||||||
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
||||||
const components = paths;
|
// don't pass changes upstream
|
||||||
|
const components = paths.slice();
|
||||||
// Add compression method to cache version to restore
|
// Add compression method to cache version to restore
|
||||||
// compressed cache as per compression method
|
// compressed cache as per compression method
|
||||||
if (compressionMethod) {
|
if (compressionMethod) {
|
||||||
@ -608,26 +609,21 @@ function resolvePaths(patterns) {
|
|||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
||||||
_c = _g.value;
|
_c = _g.value;
|
||||||
_e = false;
|
_e = false;
|
||||||
try {
|
const file = _c;
|
||||||
const file = _c;
|
const relativeFile = path
|
||||||
const relativeFile = path
|
.relative(workspace, file)
|
||||||
.relative(workspace, file)
|
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
||||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
core.debug(`Matched: ${relativeFile}`);
|
||||||
core.debug(`Matched: ${relativeFile}`);
|
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
if (relativeFile === '') {
|
||||||
if (relativeFile === '') {
|
// path.relative returns empty string if workspace and file are equal
|
||||||
// path.relative returns empty string if workspace and file are equal
|
paths.push('.');
|
||||||
paths.push('.');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
paths.push(`${relativeFile}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally {
|
else {
|
||||||
_e = true;
|
paths.push(`${relativeFile}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -729,7 +725,7 @@ var CacheFilename;
|
|||||||
(function (CacheFilename) {
|
(function (CacheFilename) {
|
||||||
CacheFilename["Gzip"] = "cache.tgz";
|
CacheFilename["Gzip"] = "cache.tgz";
|
||||||
CacheFilename["Zstd"] = "cache.tzst";
|
CacheFilename["Zstd"] = "cache.tzst";
|
||||||
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
|
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
|
||||||
var CompressionMethod;
|
var CompressionMethod;
|
||||||
(function (CompressionMethod) {
|
(function (CompressionMethod) {
|
||||||
CompressionMethod["Gzip"] = "gzip";
|
CompressionMethod["Gzip"] = "gzip";
|
||||||
@ -737,12 +733,12 @@ var CompressionMethod;
|
|||||||
// This enum is for earlier version of zstd that does not have --long support
|
// This enum is for earlier version of zstd that does not have --long support
|
||||||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||||
CompressionMethod["Zstd"] = "zstd";
|
CompressionMethod["Zstd"] = "zstd";
|
||||||
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
|
||||||
var ArchiveToolType;
|
var ArchiveToolType;
|
||||||
(function (ArchiveToolType) {
|
(function (ArchiveToolType) {
|
||||||
ArchiveToolType["GNU"] = "gnu";
|
ArchiveToolType["GNU"] = "gnu";
|
||||||
ArchiveToolType["BSD"] = "bsd";
|
ArchiveToolType["BSD"] = "bsd";
|
||||||
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
|
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
|
||||||
// The default number of retry attempts.
|
// The default number of retry attempts.
|
||||||
exports.DefaultRetryAttempts = 2;
|
exports.DefaultRetryAttempts = 2;
|
||||||
// The default delay in milliseconds between retry attempts.
|
// The default delay in milliseconds between retry attempts.
|
||||||
@ -59387,9 +59383,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.saveRun = exports.saveOnlyRun = exports.saveImpl = void 0;
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const constants_1 = __nccwpck_require__(9042);
|
const constants_1 = __nccwpck_require__(9042);
|
||||||
|
const stateProvider_1 = __nccwpck_require__(1527);
|
||||||
const utils = __importStar(__nccwpck_require__(6850));
|
const utils = __importStar(__nccwpck_require__(6850));
|
||||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||||
@ -59436,65 +59434,54 @@ function saveImpl(stateProvider) {
|
|||||||
return cacheId;
|
return cacheId;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports["default"] = saveImpl;
|
exports.saveImpl = saveImpl;
|
||||||
|
function saveOnlyRun(earlyExit) {
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 3160:
|
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
|
||||||
const saveImpl_1 = __importDefault(__nccwpck_require__(6589));
|
|
||||||
const stateProvider_1 = __nccwpck_require__(1527);
|
|
||||||
function run() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const cacheId = yield (0, saveImpl_1.default)(new stateProvider_1.NullStateProvider());
|
try {
|
||||||
if (cacheId === -1) {
|
const cacheId = yield saveImpl(new stateProvider_1.NullStateProvider());
|
||||||
core.warning(`Cache save failed.`);
|
if (cacheId === -1) {
|
||||||
|
core.warning(`Cache save failed.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
run();
|
exports.saveOnlyRun = saveOnlyRun;
|
||||||
exports["default"] = run;
|
function saveRun(earlyExit) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
yield saveImpl(new stateProvider_1.StateProvider());
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.saveRun = saveRun;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@ -59882,12 +59869,18 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/
|
var __webpack_exports__ = {};
|
||||||
/******/ // startup
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||||
/******/ // Load entry module and return exports
|
(() => {
|
||||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
"use strict";
|
||||||
/******/ var __webpack_exports__ = __nccwpck_require__(3160);
|
var exports = __webpack_exports__;
|
||||||
/******/ module.exports = __webpack_exports__;
|
|
||||||
/******/
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
const saveImpl_1 = __nccwpck_require__(6589);
|
||||||
|
(0, saveImpl_1.saveOnlyRun)(true);
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
module.exports = __webpack_exports__;
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
140
dist/save/index.js
vendored
140
dist/save/index.js
vendored
@ -319,7 +319,8 @@ function createHttpClient() {
|
|||||||
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
||||||
}
|
}
|
||||||
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
||||||
const components = paths;
|
// don't pass changes upstream
|
||||||
|
const components = paths.slice();
|
||||||
// Add compression method to cache version to restore
|
// Add compression method to cache version to restore
|
||||||
// compressed cache as per compression method
|
// compressed cache as per compression method
|
||||||
if (compressionMethod) {
|
if (compressionMethod) {
|
||||||
@ -608,26 +609,21 @@ function resolvePaths(patterns) {
|
|||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
||||||
_c = _g.value;
|
_c = _g.value;
|
||||||
_e = false;
|
_e = false;
|
||||||
try {
|
const file = _c;
|
||||||
const file = _c;
|
const relativeFile = path
|
||||||
const relativeFile = path
|
.relative(workspace, file)
|
||||||
.relative(workspace, file)
|
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
||||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
|
core.debug(`Matched: ${relativeFile}`);
|
||||||
core.debug(`Matched: ${relativeFile}`);
|
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
if (relativeFile === '') {
|
||||||
if (relativeFile === '') {
|
// path.relative returns empty string if workspace and file are equal
|
||||||
// path.relative returns empty string if workspace and file are equal
|
paths.push('.');
|
||||||
paths.push('.');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
paths.push(`${relativeFile}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally {
|
else {
|
||||||
_e = true;
|
paths.push(`${relativeFile}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -729,7 +725,7 @@ var CacheFilename;
|
|||||||
(function (CacheFilename) {
|
(function (CacheFilename) {
|
||||||
CacheFilename["Gzip"] = "cache.tgz";
|
CacheFilename["Gzip"] = "cache.tgz";
|
||||||
CacheFilename["Zstd"] = "cache.tzst";
|
CacheFilename["Zstd"] = "cache.tzst";
|
||||||
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
|
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
|
||||||
var CompressionMethod;
|
var CompressionMethod;
|
||||||
(function (CompressionMethod) {
|
(function (CompressionMethod) {
|
||||||
CompressionMethod["Gzip"] = "gzip";
|
CompressionMethod["Gzip"] = "gzip";
|
||||||
@ -737,12 +733,12 @@ var CompressionMethod;
|
|||||||
// This enum is for earlier version of zstd that does not have --long support
|
// This enum is for earlier version of zstd that does not have --long support
|
||||||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||||
CompressionMethod["Zstd"] = "zstd";
|
CompressionMethod["Zstd"] = "zstd";
|
||||||
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
|
||||||
var ArchiveToolType;
|
var ArchiveToolType;
|
||||||
(function (ArchiveToolType) {
|
(function (ArchiveToolType) {
|
||||||
ArchiveToolType["GNU"] = "gnu";
|
ArchiveToolType["GNU"] = "gnu";
|
||||||
ArchiveToolType["BSD"] = "bsd";
|
ArchiveToolType["BSD"] = "bsd";
|
||||||
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
|
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
|
||||||
// The default number of retry attempts.
|
// The default number of retry attempts.
|
||||||
exports.DefaultRetryAttempts = 2;
|
exports.DefaultRetryAttempts = 2;
|
||||||
// The default delay in milliseconds between retry attempts.
|
// The default delay in milliseconds between retry attempts.
|
||||||
@ -59347,37 +59343,6 @@ var Events;
|
|||||||
exports.RefKey = "GITHUB_REF";
|
exports.RefKey = "GITHUB_REF";
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 5131:
|
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
||||||
const saveImpl_1 = __importDefault(__nccwpck_require__(6589));
|
|
||||||
const stateProvider_1 = __nccwpck_require__(1527);
|
|
||||||
function run() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
yield (0, saveImpl_1.default)(new stateProvider_1.StateProvider());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
run();
|
|
||||||
exports["default"] = run;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 6589:
|
/***/ 6589:
|
||||||
@ -59418,9 +59383,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.saveRun = exports.saveOnlyRun = exports.saveImpl = void 0;
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const constants_1 = __nccwpck_require__(9042);
|
const constants_1 = __nccwpck_require__(9042);
|
||||||
|
const stateProvider_1 = __nccwpck_require__(1527);
|
||||||
const utils = __importStar(__nccwpck_require__(6850));
|
const utils = __importStar(__nccwpck_require__(6850));
|
||||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||||
@ -59467,7 +59434,54 @@ function saveImpl(stateProvider) {
|
|||||||
return cacheId;
|
return cacheId;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports["default"] = saveImpl;
|
exports.saveImpl = saveImpl;
|
||||||
|
function saveOnlyRun(earlyExit) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
const cacheId = yield saveImpl(new stateProvider_1.NullStateProvider());
|
||||||
|
if (cacheId === -1) {
|
||||||
|
core.warning(`Cache save failed.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.saveOnlyRun = saveOnlyRun;
|
||||||
|
function saveRun(earlyExit) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
yield saveImpl(new stateProvider_1.StateProvider());
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.saveRun = saveRun;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@ -59855,12 +59869,18 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/
|
var __webpack_exports__ = {};
|
||||||
/******/ // startup
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||||
/******/ // Load entry module and return exports
|
(() => {
|
||||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
"use strict";
|
||||||
/******/ var __webpack_exports__ = __nccwpck_require__(5131);
|
var exports = __webpack_exports__;
|
||||||
/******/ module.exports = __webpack_exports__;
|
|
||||||
/******/
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
const saveImpl_1 = __nccwpck_require__(6589);
|
||||||
|
(0, saveImpl_1.saveRun)(true);
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
module.exports = __webpack_exports__;
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
34
package-lock.json
generated
34
package-lock.json
generated
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "3.3.2",
|
"version": "4.0.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "3.3.2",
|
"version": "4.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.2",
|
"@actions/cache": "^3.2.3",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
@ -36,9 +36,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache": {
|
"node_modules/@actions/cache": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.3.tgz",
|
||||||
"integrity": "sha512-6D0Jq5JrLZRQ3VApeQwQkkV20ZZXjXsHNYXd9VjNUdi9E0h93wESpxfMJ2JWLCUCgHNLcfY0v3GjNM+2FdRMlg==",
|
"integrity": "sha512-m8KvmcD+JxSLOfNUXuBF2jL0Lp+co/Fhbf0NTt0M9lz61WnXRdqpIGrOvTRZmKIl+7HaHil6kGE3fkEfrKQCQA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
"semver": "^6.1.0",
|
"semver": "^6.3.1",
|
||||||
"uuid": "^3.3.3"
|
"uuid": "^3.3.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -893,9 +893,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/traverse": {
|
"node_modules/@babel/traverse": {
|
||||||
"version": "7.23.6",
|
"version": "7.23.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.7.tgz",
|
||||||
"integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==",
|
"integrity": "sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.23.5",
|
"@babel/code-frame": "^7.23.5",
|
||||||
@ -9533,9 +9533,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": {
|
"@actions/cache": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.3.tgz",
|
||||||
"integrity": "sha512-6D0Jq5JrLZRQ3VApeQwQkkV20ZZXjXsHNYXd9VjNUdi9E0h93wESpxfMJ2JWLCUCgHNLcfY0v3GjNM+2FdRMlg==",
|
"integrity": "sha512-m8KvmcD+JxSLOfNUXuBF2jL0Lp+co/Fhbf0NTt0M9lz61WnXRdqpIGrOvTRZmKIl+7HaHil6kGE3fkEfrKQCQA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
@ -9545,7 +9545,7 @@
|
|||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
"semver": "^6.1.0",
|
"semver": "^6.3.1",
|
||||||
"uuid": "^3.3.3"
|
"uuid": "^3.3.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10229,9 +10229,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/traverse": {
|
"@babel/traverse": {
|
||||||
"version": "7.23.6",
|
"version": "7.23.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.7.tgz",
|
||||||
"integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==",
|
"integrity": "sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.23.5",
|
"@babel/code-frame": "^7.23.5",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "3.3.2",
|
"version": "4.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Cache dependencies and build outputs",
|
"description": "Cache dependencies and build outputs",
|
||||||
"main": "dist/restore/index.js",
|
"main": "dist/restore/index.js",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.2",
|
"@actions/cache": "^3.2.3",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ outputs:
|
|||||||
cache-matched-key:
|
cache-matched-key:
|
||||||
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
|
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: '../dist/restore-only/index.js'
|
main: '../dist/restore-only/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'archive'
|
icon: 'archive'
|
||||||
|
|||||||
@ -16,7 +16,7 @@ inputs:
|
|||||||
default: 'false'
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: '../dist/save-only/index.js'
|
main: '../dist/save-only/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'archive'
|
icon: 'archive'
|
||||||
|
|||||||
11
src/save.ts
11
src/save.ts
@ -1,10 +1,3 @@
|
|||||||
import saveImpl from "./saveImpl";
|
import { saveRun } from "./saveImpl";
|
||||||
import { StateProvider } from "./stateProvider";
|
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
saveRun(true);
|
||||||
await saveImpl(new StateProvider());
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
|
|
||||||
export default run;
|
|
||||||
|
|||||||
@ -2,7 +2,11 @@ import * as cache from "@actions/cache";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import { Events, Inputs, State } from "./constants";
|
import { Events, Inputs, State } from "./constants";
|
||||||
import { IStateProvider } from "./stateProvider";
|
import {
|
||||||
|
IStateProvider,
|
||||||
|
NullStateProvider,
|
||||||
|
StateProvider
|
||||||
|
} from "./stateProvider";
|
||||||
import * as utils from "./utils/actionUtils";
|
import * as utils from "./utils/actionUtils";
|
||||||
|
|
||||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||||
@ -10,7 +14,9 @@ import * as utils from "./utils/actionUtils";
|
|||||||
// throw an uncaught exception. Instead of failing this action, just warn.
|
// throw an uncaught exception. Instead of failing this action, just warn.
|
||||||
process.on("uncaughtException", e => utils.logWarning(e.message));
|
process.on("uncaughtException", e => utils.logWarning(e.message));
|
||||||
|
|
||||||
async function saveImpl(stateProvider: IStateProvider): Promise<number | void> {
|
export async function saveImpl(
|
||||||
|
stateProvider: IStateProvider
|
||||||
|
): Promise<number | void> {
|
||||||
let cacheId = -1;
|
let cacheId = -1;
|
||||||
try {
|
try {
|
||||||
if (!utils.isCacheFeatureAvailable()) {
|
if (!utils.isCacheFeatureAvailable()) {
|
||||||
@ -72,4 +78,47 @@ async function saveImpl(stateProvider: IStateProvider): Promise<number | void> {
|
|||||||
return cacheId;
|
return cacheId;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default saveImpl;
|
export async function saveOnlyRun(
|
||||||
|
earlyExit?: boolean | undefined
|
||||||
|
): Promise<void> {
|
||||||
|
try {
|
||||||
|
const cacheId = await saveImpl(new NullStateProvider());
|
||||||
|
if (cacheId === -1) {
|
||||||
|
core.warning(`Cache save failed.`);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function saveRun(earlyExit?: boolean | undefined): Promise<void> {
|
||||||
|
try {
|
||||||
|
await saveImpl(new StateProvider());
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// node will stay alive if any promises are not resolved,
|
||||||
|
// which is a possibility if HTTP requests are dangling
|
||||||
|
// due to retries or timeouts. We know that if we got here
|
||||||
|
// that all promises that we care about have successfully
|
||||||
|
// resolved, so simply exit with success.
|
||||||
|
if (earlyExit) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,15 +1,3 @@
|
|||||||
import * as core from "@actions/core";
|
import { saveOnlyRun } from "./saveImpl";
|
||||||
|
|
||||||
import saveImpl from "./saveImpl";
|
saveOnlyRun(true);
|
||||||
import { NullStateProvider } from "./stateProvider";
|
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
|
||||||
const cacheId = await saveImpl(new NullStateProvider());
|
|
||||||
if (cacheId === -1) {
|
|
||||||
core.warning(`Cache save failed.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
|
|
||||||
export default run;
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user