8000 Fix dist · actions/cache@d0be34d · GitHub
[go: up one dir, main page]

Skip to content

Commit d0be34d

Browse files
committed
Fix dist
1 parent 66cf064 commit d0be34d

File tree

4 files changed

+68
-84
lines changed

4 files changed

+68
-84
lines changed

dist/restore-only/index.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ function createHttpClient() {
319319
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
320320
}
321321
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
322-
const components = paths;
322+
// don't pass changes upstream
323+
const components = paths.slice();
323324
// Add compression method to cache version to restore
324325
// compressed cache as per compression method
325326
if (compressionMethod) {
@@ -608,26 +609,21 @@ function resolvePaths(patterns) {
608609
implicitDescendants: false
609610
});
610611
try {
611-
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
612+
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
612613
_c = _g.value;
613614
_e = false;
614-
try {
615-
const file = _c;
616-
const relativeFile = path
617-
.relative(workspace, file)
618-
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619-
core.debug(`Matched: ${relativeFile}`);
620-
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621-
if (relativeFile === '') {
622-
// path.relative returns empty string if workspace and file are equal
623-
paths.push('.');
624-
}
625-
else {
626-
paths.push(`${relativeFile}`);
627-
}
615+
const file = _c;
616+
const relativeFile = path
617+
.relative(workspace, file)
618+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619+
core.debug(`Matched: ${relativeFile}`);
620+
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621+
if (relativeFile === '') {
622+
// path.relative returns empty string if workspace and file are equal
623+
paths.push('.');
628624
}
629-
finally {
630-
_e = true;
625+
else {
626+
paths.push(`${relativeFile}`);
631627
}
632628
}
633629
}
@@ -729,20 +725,20 @@ var CacheFilename;
729725
(function (CacheFilename) {
730726
CacheFilename["Gzip"] = "cache.tgz";
731727
CacheFilename["Zstd"] = "cache.tzst";
732-
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
728+
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
733729
var CompressionMethod;
734730
(function (CompressionMethod) {
735731
CompressionMethod["Gzip"] = "gzip";
736732
// Long range mode was added to zstd in v1.3.2.
737733
// This enum is for earlier version of zstd that does not have --long support
738734
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
739735
CompressionMethod["Zstd"] = "zstd";
740-
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
736+
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
741737
var ArchiveToolType;
742738
(function (ArchiveToolType) {
743739
ArchiveToolType["GNU"] = "gnu";
744740
ArchiveToolType["BSD"] = "bsd";
745-
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
741+
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
746742
// The default number of retry attempts.
747743
exports.DefaultRetryAttempts = 2;
748744
// The default delay in milliseconds between retry attempts.

dist/restore/index.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ function createHttpClient() {
319319
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
320320
}
321321
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
322-
const components = paths;
322+
// don't pass changes upstream
323+
const components = paths.slice();
323324
// Add compression method to cache version to restore
324325
// compressed cache as per compression method
325326
if (compressionMethod) {
@@ -608,26 +609,21 @@ function resolvePaths(patterns) {
608609
implicitDescendants: false
609610
});
610611
try {
611-
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
612+
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
612613
_c = _g.value;
613614
_e = false;
614-
try {
615-
const file = _c;
616-
const relativeFile = path
617-
.relative(workspace, file)
618-
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619-
core.debug(`Matched: ${relativeFile}`);
620-
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621-
if (relativeFile === '') {
622-
// path.relative returns empty string if workspace and file are equal
623-
paths.push('.');
624-
}
625-
else {
626-
paths.push(`${relativeFile}`);
627-
}
615+
const file = _c;
616+
const relativeFile = path
617+
.relative(workspace, file)
618+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619+
core.debug(`Matched: ${relativeFile}`);
620+
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621+
if (relativeFile === '') {
622+
// path.relative returns empty string if workspace and file are equal
623+
paths.push('.');
628624
}
629-
finally {
630-
_e = true;
625+
else {
626+
paths.push(`${relativeFile}`);
631627
}
632628
}
633629
}
@@ -729,20 +725,20 @@ var CacheFilename;
729725
(function (CacheFilename) {
730726
CacheFilename["Gzip"] = "cache.tgz";
731727
CacheFilename["Zstd"] = "cache.tzst";
732-
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
728+
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
733729
var CompressionMethod;
734730
(function (CompressionMethod) {
735731
CompressionMethod["Gzip"] = "gzip";
736732
// Long range mode was added to zstd in v1.3.2.
737733
// This enum is for earlier version of zstd that does not have --long support
738734
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
739735
CompressionMethod["Zstd"] = "zstd";
740-
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
736+
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
741737
var ArchiveToolType;
742738
(function (ArchiveToolType) {
743739
ArchiveToolType["GNU"] = "gnu";
744740
ArchiveToolType["BSD"] = "bsd";
745-
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
741+
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
746742
// The default number of retry attempts.
747743
exports.DefaultRetryAttempts = 2;
748744
// The default delay in milliseconds between retry attempts.

dist/save-only/index.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ function createHttpClient() {
319319
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
320320
}
321321
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
322-
const components = paths;
322+
// don't pass changes upstream
323+
const components = paths.slice();
323324
// Add compression method to cache version to restore
324325
// compressed cache as per compression method
325326
if (compressionMethod) {
@@ -608,26 +609,21 @@ function resolvePaths(patterns) {
608609
implicitDescendants: false
609610
});
610611
try {
611-
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
612+
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
612613
_c = _g.value;
613614
_e = false;
614-
try {
615-
const file = _c;
616-
const relativeFile = path
617-
.relative(workspace, file)
618-
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619-
core.debug(`Matched: ${relativeFile}`);
620-
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621-
if (relativeFile === '') {
622-
// path.relative returns empty string if workspace and file are equal
623-
paths.push('.');
624-
}
625-
else {
626-
paths.push(`${relativeFile}`);
627-
}
615+
const file = _c;
616+
const relativeFile = path
617+
.relative(workspace, file)
618+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619+
core.debug(`Matched: ${relativeFile}`);
620+
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621+
if (relativeFile === '') {
622+
// path.relative returns empty string if workspace and file are equal
623+
paths.push('.');
628624
}
629-
finally {
630-
_e = true;
625+
else {
626+
paths.push(`${relativeFile}`);
631627
}
632628
}
633629
}
@@ -729,20 +725,20 @@ var CacheFilename;
729725
(function (CacheFilename) {
730726
CacheFilename["Gzip"] = "cache.tgz";
731727
CacheFilename["Zstd"] = "cache.tzst";
732-
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
728+
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
733729
var CompressionMethod;
734730
(function (CompressionMethod) {
735731
CompressionMethod["Gzip"] = "gzip";
736732
// Long range mode was added to zstd in v1.3.2.
737733
// This enum is for earlier version of zstd that does not have --long support
738734
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
739735
CompressionMethod["Zstd"] = "zstd";
740-
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
736+
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
741737
var ArchiveToolType;
742738
(function (ArchiveToolType) {
743739
ArchiveToolType["GNU"] = "gnu";
744740
ArchiveToolType["BSD"] = "bsd";
745-
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
741+
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
746742
// The default number of retry attempts.
747743
exports.DefaultRetryAttempts = 2;
748744
// The default delay in milliseconds between retry attempts.

dist/save/index.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ function createHttpClient() {
319319
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
320320
}
321321
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
322-
const components = paths;
322+
// don't pass changes upstream
323+
const components = paths.slice();
323324
// Add compression method to cache version to restore
324325
// compressed cache as per compression method
325326
if (compressionMethod) {
@@ -608,26 +609,21 @@ function resolvePaths(patterns) {
608609
implicitDescendants: false
609610
});
610611
try {
611-
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {
612+
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
612613
_c = _g.value;
613614
_e = false;
614-
try {
615-
const file = _c;
616-
const relativeFile = path
617-
.relative(workspace, file)
618-
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619-
core.debug(`Matched: ${relativeFile}`);
620-
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621-
if (relativeFile === '') {
622-
// path.relative returns empty string if workspace and file are equal
623-
paths.push('.');
624-
}
625-
else {
626-
paths.push(`${relativeFile}`);
627-
}
615+
const file = _c;
616+
const relativeFile = path
617+
.relative(workspace, file)
618+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
619+
core.debug(`Matched: ${relativeFile}`);
620+
// Paths are made relative so the tar entries are all relative to the root of the workspace.
621+
if (relativeFile === '') {
622+
// path.relative returns empty string if workspace and file are equal
623+
paths.push('.');
628624
}
629-
finally {
630-
_e = true;
625+
else {
626+
paths.push(`${relativeFile}`);
631627
}
632628
}
633629
}
@@ -729,20 +725,20 @@ var CacheFilename;
729725
(function (CacheFilename) {
730726
CacheFilename["Gzip"] = "cache.tgz";
731727
CacheFilename["Zstd"] = "cache.tzst";
732-
})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));
728+
})(CacheFilename || (exports.CacheFilename = CacheFilename = {}));
733729
var CompressionMethod;
734730
(function (CompressionMethod) {
735731
CompressionMethod["Gzip"] = "gzip";
736732
// Long range mode was added to zstd in v1.3.2.
737733
// This enum is for earlier version of zstd that does not have --long support
738734
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
739735
CompressionMethod["Zstd"] = "zstd";
740-
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
736+
})(CompressionMethod || (exports.CompressionMethod = CompressionMethod = {}));
741737
var ArchiveToolType;
742738
(function (ArchiveToolType) {
743739
ArchiveToolType["GNU"] = "gnu";
744740
ArchiveToolType["BSD"] = "bsd";
745-
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
741+
})(ArchiveToolType || (exports.ArchiveToolType = ArchiveToolType = {}));
746742
// The default number of retry attempts.
747743
exports.DefaultRetryAttempts = 2;
748744
// The default delay in milliseconds between retry attempts.

0 commit comments

Comments
 (0)
0