Fix dist · actions/cache@d0be34d (original) (raw)
4 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -319,7 +319,8 @@ function createHttpClient() { | ||
319 | 319 | return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions()); |
320 | 320 | } |
321 | 321 | function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { |
322 | - const components = paths; | |
322 | + // don't pass changes upstream | |
323 | + const components = paths.slice(); | |
323 | 324 | // Add compression method to cache version to restore |
324 | 325 | // compressed cache as per compression method |
325 | 326 | if (compressionMethod) { |
@@ -608,26 +609,21 @@ function resolvePaths(patterns) { | ||
608 | 609 | implicitDescendants: false |
609 | 610 | }); |
610 | 611 | 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) { | |
612 | 613 | _c = _g.value; |
613 | 614 | _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('.'); | |
628 | 624 | } |
629 | -finally { | |
630 | -_e = true; | |
625 | +else { | |
626 | +paths.push(`${relativeFile}`); | |
631 | 627 | } |
632 | 628 | } |
633 | 629 | } |
@@ -729,20 +725,20 @@ var CacheFilename; | ||
729 | 725 | (function (CacheFilename) { |
730 | 726 | CacheFilename["Gzip"] = "cache.tgz"; |
731 | 727 | CacheFilename["Zstd"] = "cache.tzst"; |
732 | -})(CacheFilename = exports.CacheFilename | | |
728 | +})(CacheFilename | | |
733 | 729 | var CompressionMethod; |
734 | 730 | (function (CompressionMethod) { |
735 | 731 | CompressionMethod["Gzip"] = "gzip"; |
736 | 732 | // Long range mode was added to zstd in v1.3.2. |
737 | 733 | // This enum is for earlier version of zstd that does not have --long support |
738 | 734 | CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; |
739 | 735 | CompressionMethod["Zstd"] = "zstd"; |
740 | -})(CompressionMethod = exports.CompressionMethod | | |
736 | +})(CompressionMethod | | |
741 | 737 | var ArchiveToolType; |
742 | 738 | (function (ArchiveToolType) { |
743 | 739 | ArchiveToolType["GNU"] = "gnu"; |
744 | 740 | ArchiveToolType["BSD"] = "bsd"; |
745 | -})(ArchiveToolType = exports.ArchiveToolType | | |
741 | +})(ArchiveToolType | | |
746 | 742 | // The default number of retry attempts. |
747 | 743 | exports.DefaultRetryAttempts = 2; |
748 | 744 | // The default delay in milliseconds between retry attempts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -319,7 +319,8 @@ function createHttpClient() { | ||
319 | 319 | return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions()); |
320 | 320 | } |
321 | 321 | function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { |
322 | - const components = paths; | |
322 | + // don't pass changes upstream | |
323 | + const components = paths.slice(); | |
323 | 324 | // Add compression method to cache version to restore |
324 | 325 | // compressed cache as per compression method |
325 | 326 | if (compressionMethod) { |
@@ -608,26 +609,21 @@ function resolvePaths(patterns) { | ||
608 | 609 | implicitDescendants: false |
609 | 610 | }); |
610 | 611 | 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) { | |
612 | 613 | _c = _g.value; |
613 | 614 | _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('.'); | |
628 | 624 | } |
629 | -finally { | |
630 | -_e = true; | |
625 | +else { | |
626 | +paths.push(`${relativeFile}`); | |
631 | 627 | } |
632 | 628 | } |
633 | 629 | } |
@@ -729,20 +725,20 @@ var CacheFilename; | ||
729 | 725 | (function (CacheFilename) { |
730 | 726 | CacheFilename["Gzip"] = "cache.tgz"; |
731 | 727 | CacheFilename["Zstd"] = "cache.tzst"; |
732 | -})(CacheFilename = exports.CacheFilename | | |
728 | +})(CacheFilename | | |
733 | 729 | var CompressionMethod; |
734 | 730 | (function (CompressionMethod) { |
735 | 731 | CompressionMethod["Gzip"] = "gzip"; |
736 | 732 | // Long range mode was added to zstd in v1.3.2. |
737 | 733 | // This enum is for earlier version of zstd that does not have --long support |
738 | 734 | CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; |
739 | 735 | CompressionMethod["Zstd"] = "zstd"; |
740 | -})(CompressionMethod = exports.CompressionMethod | | |
736 | +})(CompressionMethod | | |
741 | 737 | var ArchiveToolType; |
742 | 738 | (function (ArchiveToolType) { |
743 | 739 | ArchiveToolType["GNU"] = "gnu"; |
744 | 740 | ArchiveToolType["BSD"] = "bsd"; |
745 | -})(ArchiveToolType = exports.ArchiveToolType | | |
741 | +})(ArchiveToolType | | |
746 | 742 | // The default number of retry attempts. |
747 | 743 | exports.DefaultRetryAttempts = 2; |
748 | 744 | // The default delay in milliseconds between retry attempts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -319,7 +319,8 @@ function createHttpClient() { | ||
319 | 319 | return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions()); |
320 | 320 | } |
321 | 321 | function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { |
322 | - const components = paths; | |
322 | + // don't pass changes upstream | |
323 | + const components = paths.slice(); | |
323 | 324 | // Add compression method to cache version to restore |
324 | 325 | // compressed cache as per compression method |
325 | 326 | if (compressionMethod) { |
@@ -608,26 +609,21 @@ function resolvePaths(patterns) { | ||
608 | 609 | implicitDescendants: false |
609 | 610 | }); |
610 | 611 | 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) { | |
612 | 613 | _c = _g.value; |
613 | 614 | _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('.'); | |
628 | 624 | } |
629 | -finally { | |
630 | -_e = true; | |
625 | +else { | |
626 | +paths.push(`${relativeFile}`); | |
631 | 627 | } |
632 | 628 | } |
633 | 629 | } |
@@ -729,20 +725,20 @@ var CacheFilename; | ||
729 | 725 | (function (CacheFilename) { |
730 | 726 | CacheFilename["Gzip"] = "cache.tgz"; |
731 | 727 | CacheFilename["Zstd"] = "cache.tzst"; |
732 | -})(CacheFilename = exports.CacheFilename | | |
728 | +})(CacheFilename | | |
733 | 729 | var CompressionMethod; |
734 | 730 | (function (CompressionMethod) { |
735 | 731 | CompressionMethod["Gzip"] = "gzip"; |
736 | 732 | // Long range mode was added to zstd in v1.3.2. |
737 | 733 | // This enum is for earlier version of zstd that does not have --long support |
738 | 734 | CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; |
739 | 735 | CompressionMethod["Zstd"] = "zstd"; |
740 | -})(CompressionMethod = exports.CompressionMethod | | |
736 | +})(CompressionMethod | | |
741 | 737 | var ArchiveToolType; |
742 | 738 | (function (ArchiveToolType) { |
743 | 739 | ArchiveToolType["GNU"] = "gnu"; |
744 | 740 | ArchiveToolType["BSD"] = "bsd"; |
745 | -})(ArchiveToolType = exports.ArchiveToolType | | |
741 | +})(ArchiveToolType | | |
746 | 742 | // The default number of retry attempts. |
747 | 743 | exports.DefaultRetryAttempts = 2; |
748 | 744 | // The default delay in milliseconds between retry attempts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -319,7 +319,8 @@ function createHttpClient() { | ||
319 | 319 | return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions()); |
320 | 320 | } |
321 | 321 | function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { |
322 | - const components = paths; | |
322 | + // don't pass changes upstream | |
323 | + const components = paths.slice(); | |
323 | 324 | // Add compression method to cache version to restore |
324 | 325 | // compressed cache as per compression method |
325 | 326 | if (compressionMethod) { |
@@ -608,26 +609,21 @@ function resolvePaths(patterns) { | ||
608 | 609 | implicitDescendants: false |
609 | 610 | }); |
610 | 611 | 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) { | |
612 | 613 | _c = _g.value; |
613 | 614 | _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('.'); | |
628 | 624 | } |
629 | -finally { | |
630 | -_e = true; | |
625 | +else { | |
626 | +paths.push(`${relativeFile}`); | |
631 | 627 | } |
632 | 628 | } |
633 | 629 | } |
@@ -729,20 +725,20 @@ var CacheFilename; | ||
729 | 725 | (function (CacheFilename) { |
730 | 726 | CacheFilename["Gzip"] = "cache.tgz"; |
731 | 727 | CacheFilename["Zstd"] = "cache.tzst"; |
732 | -})(CacheFilename = exports.CacheFilename | | |
728 | +})(CacheFilename | | |
733 | 729 | var CompressionMethod; |
734 | 730 | (function (CompressionMethod) { |
735 | 731 | CompressionMethod["Gzip"] = "gzip"; |
736 | 732 | // Long range mode was added to zstd in v1.3.2. |
737 | 733 | // This enum is for earlier version of zstd that does not have --long support |
738 | 734 | CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; |
739 | 735 | CompressionMethod["Zstd"] = "zstd"; |
740 | -})(CompressionMethod = exports.CompressionMethod | | |
736 | +})(CompressionMethod | | |
741 | 737 | var ArchiveToolType; |
742 | 738 | (function (ArchiveToolType) { |
743 | 739 | ArchiveToolType["GNU"] = "gnu"; |
744 | 740 | ArchiveToolType["BSD"] = "bsd"; |
745 | -})(ArchiveToolType = exports.ArchiveToolType | | |
741 | +})(ArchiveToolType | | |
746 | 742 | // The default number of retry attempts. |
747 | 743 | exports.DefaultRetryAttempts = 2; |
748 | 744 | // The default delay in milliseconds between retry attempts. |