Compare commits

...

8 Commits

Author SHA1 Message Date
8546a7057e console res 2022-03-31 14:54:56 +05:30
fa608b2294 console res 2022-03-31 13:04:01 +05:30
a54eb92c7c console res 2022-03-30 18:29:58 +05:30
1239bf6914 console res 2022-03-30 18:23:49 +05:30
2ce8d02f04 console res 2022-03-30 16:02:49 +05:30
aad9d15d47 new tollkit and isghes 2022-03-29 23:49:07 +05:30
2d8d0d1c9b Updated what's new. (#771)
* Updated what's new.

* Segregated major versions and added changelog.

* Update README.md
2022-03-22 14:04:39 +05:30
7799d864d9 Updated the usage and docs to the major version release. (#770) 2022-03-21 14:31:26 +05:30
9 changed files with 175 additions and 613 deletions

View File

@ -34,7 +34,7 @@ jobs:
run: | run: |
echo "::set-output name=dir::$(npm config get cache)" echo "::set-output name=dir::$(npm config get cache)"
- name: Restore npm cache - name: Restore npm cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ${{ steps.npm-cache.outputs.dir }} path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

View File

@ -9,12 +9,16 @@ This action allows caching dependencies and build outputs to improve workflow ex
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows). See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
## What's New ## What's New
### v3
* Updated the minimum runner version support from node 12 -> node 16.
### v2
* Increased the cache size limit to 10 GB.
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches. * Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
```yaml ```yaml
- name: Cache multiple paths - name: Cache multiple paths
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/cache ~/cache
@ -69,7 +73,7 @@ jobs:
- name: Cache Primes - name: Cache Primes
id: cache-primes id: cache-primes
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: prime-numbers path: prime-numbers
key: ${{ runner.os }}-primes key: ${{ runner.os }}-primes
@ -119,7 +123,7 @@ A cache key can include any of the contexts, functions, literals, and operators
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change. For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
path/to/dependencies path/to/dependencies
@ -137,7 +141,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash shell: bash
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: path/to/dependencies path: path/to/dependencies
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }} key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
@ -158,7 +162,7 @@ Example:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/cache@v2 - uses: actions/cache@v3
id: cache id: cache
with: with:
path: path/to/dependencies path: path/to/dependencies
@ -177,6 +181,12 @@ steps:
Since GitHub Enterprise Server uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (npm, maven, etc.). This eliminates the need for explicit caching in some scenarios. Since GitHub Enterprise Server uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (npm, maven, etc.). This eliminates the need for explicit caching in some scenarios.
## Changelog schedule and history
| Status | Version | Date | Highlights |
|:---|:---|:---|:---|
| Published | v3.0.0 | Mar 21st, 2022 | - Updated minimum runner version support from node 12 -> node 16 <br> |
## Contributing ## Contributing
We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information. We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

View File

@ -20,7 +20,7 @@ afterEach(() => {
test("isGhes returns true if server url is not github.com", () => { test("isGhes returns true if server url is not github.com", () => {
try { try {
process.env["GITHUB_SERVER_URL"] = "http://example.com"; process.env["GITHUB_SERVER_URL"] = "http://example.com";
expect(actionUtils.isGhes()).toBe(true); expect(actionUtils.isGhes()).toBe(false);
} finally { } finally {
process.env["GITHUB_SERVER_URL"] = undefined; process.env["GITHUB_SERVER_URL"] = undefined;
} }

334
dist/restore/index.js vendored
View File

@ -1405,36 +1405,7 @@ exports.default = _default;
/* 39 */, /* 39 */,
/* 40 */, /* 40 */,
/* 41 */, /* 41 */,
/* 42 */ /* 42 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTraceState = void 0;
var tracestate_impl_1 = __webpack_require__(756);
function createTraceState(rawTraceState) {
return new tracestate_impl_1.TraceStateImpl(rawTraceState);
}
exports.createTraceState = createTraceState;
//# sourceMappingURL=utils.js.map
/***/ }),
/* 43 */, /* 43 */,
/* 44 */, /* 44 */,
/* 45 */, /* 45 */,
@ -3221,10 +3192,7 @@ const options_1 = __webpack_require__(538);
const requestUtils_1 = __webpack_require__(899); const requestUtils_1 = __webpack_require__(899);
const versionSalt = '1.0'; const versionSalt = '1.0';
function getCacheApiUrl(resource) { function getCacheApiUrl(resource) {
// Ideally we just use ACTIONS_CACHE_URL const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
'').replace('pipelines', 'artifactcache');
if (!baseUrl) { if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.'); throw new Error('Cache Service Url not found, unable to restore cache.');
} }
@ -3302,18 +3270,19 @@ function downloadCache(archiveLocation, archivePath, options) {
exports.downloadCache = downloadCache; exports.downloadCache = downloadCache;
// Reserve Cache // Reserve Cache
function reserveCache(key, paths, options) { function reserveCache(key, paths, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const httpClient = createHttpClient(); const httpClient = createHttpClient();
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod); const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
const reserveCacheRequest = { const reserveCacheRequest = {
key, key,
version version,
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
}; };
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () { const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest); return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
})); }));
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1; console.log(response);
return response;
}); });
} }
exports.reserveCache = reserveCache; exports.reserveCache = reserveCache;
@ -4470,7 +4439,7 @@ var NoopTracer_1 = __webpack_require__(151);
var NoopTracerProvider = /** @class */ (function () { var NoopTracerProvider = /** @class */ (function () {
function NoopTracerProvider() { function NoopTracerProvider() {
} }
NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) { NoopTracerProvider.prototype.getTracer = function (_name, _version) {
return new NoopTracer_1.NoopTracer(); return new NoopTracer_1.NoopTracer();
}; };
return NoopTracerProvider; return NoopTracerProvider;
@ -5519,7 +5488,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
// //
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments // on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH; // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength); const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w'); const fd = fs.openSync(archivePath, 'w');
try { try {
@ -36293,9 +36263,9 @@ var ProxyTracerProvider = /** @class */ (function () {
/** /**
* Get a {@link ProxyTracer} * Get a {@link ProxyTracer}
*/ */
ProxyTracerProvider.prototype.getTracer = function (name, version, options) { ProxyTracerProvider.prototype.getTracer = function (name, version) {
var _a; var _a;
return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options)); return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version));
}; };
ProxyTracerProvider.prototype.getDelegate = function () { ProxyTracerProvider.prototype.getDelegate = function () {
var _a; var _a;
@ -36307,9 +36277,9 @@ var ProxyTracerProvider = /** @class */ (function () {
ProxyTracerProvider.prototype.setDelegate = function (delegate) { ProxyTracerProvider.prototype.setDelegate = function (delegate) {
this._delegate = delegate; this._delegate = delegate;
}; };
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) { ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {
var _a; var _a;
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);
}; };
return ProxyTracerProvider; return ProxyTracerProvider;
}()); }());
@ -36348,11 +36318,10 @@ var NOOP_TRACER = new NoopTracer_1.NoopTracer();
* Proxy tracer provided by the proxy tracer provider * Proxy tracer provided by the proxy tracer provider
*/ */
var ProxyTracer = /** @class */ (function () { var ProxyTracer = /** @class */ (function () {
function ProxyTracer(_provider, name, version, options) { function ProxyTracer(_provider, name, version) {
this._provider = _provider; this._provider = _provider;
this.name = name; this.name = name;
this.version = version; this.version = version;
this.options = options;
} }
ProxyTracer.prototype.startSpan = function (name, options, context) { ProxyTracer.prototype.startSpan = function (name, options, context) {
return this._getTracer().startSpan(name, options, context); return this._getTracer().startSpan(name, options, context);
@ -36369,7 +36338,7 @@ var ProxyTracer = /** @class */ (function () {
if (this._delegate) { if (this._delegate) {
return this._delegate; return this._delegate;
} }
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); var tracer = this._provider.getDelegateTracer(this.name, this.version);
if (!tracer) { if (!tracer) {
return NOOP_TRACER; return NOOP_TRACER;
} }
@ -37369,13 +37338,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.baggageEntryMetadataFromString = void 0; exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.baggageEntryMetadataFromString = void 0;
__exportStar(__webpack_require__(880), exports); __exportStar(__webpack_require__(880), exports);
var utils_1 = __webpack_require__(112); var utils_1 = __webpack_require__(112);
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } }); Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
__exportStar(__webpack_require__(452), exports); __exportStar(__webpack_require__(452), exports);
__exportStar(__webpack_require__(158), exports); __exportStar(__webpack_require__(158), exports);
__exportStar(__webpack_require__(907), exports);
__exportStar(__webpack_require__(893), exports); __exportStar(__webpack_require__(893), exports);
__exportStar(__webpack_require__(881), exports); __exportStar(__webpack_require__(881), exports);
__exportStar(__webpack_require__(906), exports); __exportStar(__webpack_require__(906), exports);
@ -37391,11 +37359,8 @@ __exportStar(__webpack_require__(220), exports);
__exportStar(__webpack_require__(932), exports); __exportStar(__webpack_require__(932), exports);
__exportStar(__webpack_require__(975), exports); __exportStar(__webpack_require__(975), exports);
__exportStar(__webpack_require__(207), exports); __exportStar(__webpack_require__(207), exports);
var utils_2 = __webpack_require__(42);
Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function () { return utils_2.createTraceState; } });
__exportStar(__webpack_require__(694), exports); __exportStar(__webpack_require__(694), exports);
__exportStar(__webpack_require__(695), exports); __exportStar(__webpack_require__(695), exports);
__exportStar(__webpack_require__(743), exports);
var spancontext_utils_1 = __webpack_require__(629); var spancontext_utils_1 = __webpack_require__(629);
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } }); Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } }); Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
@ -37463,8 +37428,7 @@ exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports
const core = __importStar(__webpack_require__(470)); const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(196); const constants_1 = __webpack_require__(196);
function isGhes() { function isGhes() {
const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); return false;
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
} }
exports.isGhes = isGhes; exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) { function isExactKeyMatch(key, cacheKey) {
@ -42117,58 +42081,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
/* 587 */, /* 587 */,
/* 588 */, /* 588 */,
/* 589 */, /* 589 */,
/* 590 */ /* 590 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateValue = exports.validateKey = void 0;
var VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
var VALID_KEY = "[a-z]" + VALID_KEY_CHAR_RANGE + "{0,255}";
var VALID_VENDOR_KEY = "[a-z0-9]" + VALID_KEY_CHAR_RANGE + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE + "{0,13}";
var VALID_KEY_REGEX = new RegExp("^(?:" + VALID_KEY + "|" + VALID_VENDOR_KEY + ")$");
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
/**
* Key is opaque string up to 256 characters printable. It MUST begin with a
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
* underscores _, dashes -, asterisks *, and forward slashes /.
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
* see https://www.w3.org/TR/trace-context/#key
*/
function validateKey(key) {
return VALID_KEY_REGEX.test(key);
}
exports.validateKey = validateKey;
/**
* Value is opaque string up to 256 characters printable ASCII RFC0020
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
*/
function validateValue(value) {
return (VALID_VALUE_BASE_REGEX.test(value) &&
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));
}
exports.validateValue = validateValue;
//# sourceMappingURL=tracestate-validators.js.map
/***/ }),
/* 591 */, /* 591 */,
/* 592 */, /* 592 */,
/* 593 */, /* 593 */,
@ -46439,6 +46352,15 @@ function checkKey(key) {
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
} }
} }
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/** /**
* Restores cache from keys * Restores cache from keys
* *
@ -46509,14 +46431,7 @@ function saveCache(paths, key, options) {
checkPaths(paths); checkPaths(paths);
checkKey(key); checkKey(key);
const compressionMethod = yield utils.getCompressionMethod(); const compressionMethod = yield utils.getCompressionMethod();
core.debug('Reserving Cache'); let cacheId = null;
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod
});
if (cacheId === -1) {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
}
core.debug(`Cache ID: ${cacheId}`);
const cachePaths = yield utils.resolvePaths(paths); const cachePaths = yield utils.resolvePaths(paths);
core.debug('Cache Paths:'); core.debug('Cache Paths:');
core.debug(`${JSON.stringify(cachePaths)}`); core.debug(`${JSON.stringify(cachePaths)}`);
@ -46528,12 +46443,29 @@ function saveCache(paths, key, options) {
if (core.isDebug()) { if (core.isDebug()) {
yield tar_1.listTar(archivePath, compressionMethod); yield tar_1.listTar(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
if (archiveFileSize > fileSizeLimit) { const cacheSize = archiveFileSize;
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); core.debug('Reserving Cache');
} let reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod,
cacheSize
});
// if(reserveCacheResponse?.statusCode === 400 && reserveCacheResponse?.result?.typeKey === "InvalidReserveCacheRequestException"){
// throw new ReserveCacheError(
// reserveCacheResponse?.result?.message ??
// `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
// )
// }
// if(reserveCacheResponse?.result?.cacheId){
// cacheId = reserveCacheResponse?.result?.cacheId
// }else{
// throw new ReserveCacheError(
// `Unable to reserve cache with key ${key}, another job may be creating this cache.`
// )
// }
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
core.debug(`Cache ID: ${cacheId}`);
core.debug(`Saving Cache (ID: ${cacheId})`); core.debug(`Saving Cache (ID: ${cacheId})`);
yield cacheHttpClient.saveCache(cacheId, archivePath, options); yield cacheHttpClient.saveCache(cacheId, archivePath, options);
} }
@ -47220,30 +47152,7 @@ exports.OidcClient = OidcClient;
//# sourceMappingURL=oidc-utils.js.map //# sourceMappingURL=oidc-utils.js.map
/***/ }), /***/ }),
/* 743 */ /* 743 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=tracer_options.js.map
/***/ }),
/* 744 */, /* 744 */,
/* 745 */, /* 745 */,
/* 746 */, /* 746 */,
@ -47340,117 +47249,7 @@ function async(callback)
/* 753 */, /* 753 */,
/* 754 */, /* 754 */,
/* 755 */, /* 755 */,
/* 756 */ /* 756 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TraceStateImpl = void 0;
var tracestate_validators_1 = __webpack_require__(590);
var MAX_TRACE_STATE_ITEMS = 32;
var MAX_TRACE_STATE_LEN = 512;
var LIST_MEMBERS_SEPARATOR = ',';
var LIST_MEMBER_KEY_VALUE_SPLITTER = '=';
/**
* TraceState must be a class and not a simple object type because of the spec
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
*
* Here is the list of allowed mutations:
* - New key-value pair should be added into the beginning of the list
* - The value of any key can be updated. Modified keys MUST be moved to the
* beginning of the list.
*/
var TraceStateImpl = /** @class */ (function () {
function TraceStateImpl(rawTraceState) {
this._internalState = new Map();
if (rawTraceState)
this._parse(rawTraceState);
}
TraceStateImpl.prototype.set = function (key, value) {
// TODO: Benchmark the different approaches(map vs list) and
// use the faster one.
var traceState = this._clone();
if (traceState._internalState.has(key)) {
traceState._internalState.delete(key);
}
traceState._internalState.set(key, value);
return traceState;
};
TraceStateImpl.prototype.unset = function (key) {
var traceState = this._clone();
traceState._internalState.delete(key);
return traceState;
};
TraceStateImpl.prototype.get = function (key) {
return this._internalState.get(key);
};
TraceStateImpl.prototype.serialize = function () {
var _this = this;
return this._keys()
.reduce(function (agg, key) {
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));
return agg;
}, [])
.join(LIST_MEMBERS_SEPARATOR);
};
TraceStateImpl.prototype._parse = function (rawTraceState) {
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
return;
this._internalState = rawTraceState
.split(LIST_MEMBERS_SEPARATOR)
.reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning
.reduce(function (agg, part) {
var listMember = part.trim(); // Optional Whitespace (OWS) handling
var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
if (i !== -1) {
var key = listMember.slice(0, i);
var value = listMember.slice(i + 1, part.length);
if (tracestate_validators_1.validateKey(key) && tracestate_validators_1.validateValue(value)) {
agg.set(key, value);
}
else {
// TODO: Consider to add warning log
}
}
return agg;
}, new Map());
// Because of the reverse() requirement, trunc must be done after map is created
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
this._internalState = new Map(Array.from(this._internalState.entries())
.reverse() // Use reverse same as original tracestate parse chain
.slice(0, MAX_TRACE_STATE_ITEMS));
}
};
TraceStateImpl.prototype._keys = function () {
return Array.from(this._internalState.keys()).reverse();
};
TraceStateImpl.prototype._clone = function () {
var traceState = new TraceStateImpl();
traceState._internalState = new Map(this._internalState);
return traceState;
};
return TraceStateImpl;
}());
exports.TraceStateImpl = TraceStateImpl;
//# sourceMappingURL=tracestate-impl.js.map
/***/ }),
/* 757 */, /* 757 */,
/* 758 */, /* 758 */,
/* 759 */, /* 759 */,
@ -49634,7 +49433,7 @@ module.exports = v4;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0; exports.VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js // this is autogenerated file, see scripts/version-update.js
exports.VERSION = '1.1.0'; exports.VERSION = '1.0.4';
//# sourceMappingURL=version.js.map //# sourceMappingURL=version.js.map
/***/ }), /***/ }),
@ -51766,7 +51565,9 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
return { return {
statusCode: error.statusCode, statusCode: error.statusCode,
result: null, result: null,
headers: {} headers: {},
message: error.message,
typeKey: error.result
}; };
} }
else { else {
@ -51857,30 +51658,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=attributes.js.map //# sourceMappingURL=attributes.js.map
/***/ }), /***/ }),
/* 907 */ /* 907 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Attributes.js.map
/***/ }),
/* 908 */, /* 908 */,
/* 909 */, /* 909 */,
/* 910 */ /* 910 */

334
dist/save/index.js vendored
View File

@ -1405,36 +1405,7 @@ exports.default = _default;
/* 39 */, /* 39 */,
/* 40 */, /* 40 */,
/* 41 */, /* 41 */,
/* 42 */ /* 42 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTraceState = void 0;
var tracestate_impl_1 = __webpack_require__(756);
function createTraceState(rawTraceState) {
return new tracestate_impl_1.TraceStateImpl(rawTraceState);
}
exports.createTraceState = createTraceState;
//# sourceMappingURL=utils.js.map
/***/ }),
/* 43 */, /* 43 */,
/* 44 */, /* 44 */,
/* 45 */, /* 45 */,
@ -3221,10 +3192,7 @@ const options_1 = __webpack_require__(538);
const requestUtils_1 = __webpack_require__(899); const requestUtils_1 = __webpack_require__(899);
const versionSalt = '1.0'; const versionSalt = '1.0';
function getCacheApiUrl(resource) { function getCacheApiUrl(resource) {
// Ideally we just use ACTIONS_CACHE_URL const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
'').replace('pipelines', 'artifactcache');
if (!baseUrl) { if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.'); throw new Error('Cache Service Url not found, unable to restore cache.');
} }
@ -3302,18 +3270,19 @@ function downloadCache(archiveLocation, archivePath, options) {
exports.downloadCache = downloadCache; exports.downloadCache = downloadCache;
// Reserve Cache // Reserve Cache
function reserveCache(key, paths, options) { function reserveCache(key, paths, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const httpClient = createHttpClient(); const httpClient = createHttpClient();
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod); const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
const reserveCacheRequest = { const reserveCacheRequest = {
key, key,
version version,
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
}; };
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () { const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest); return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
})); }));
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1; console.log(response);
return response;
}); });
} }
exports.reserveCache = reserveCache; exports.reserveCache = reserveCache;
@ -4470,7 +4439,7 @@ var NoopTracer_1 = __webpack_require__(151);
var NoopTracerProvider = /** @class */ (function () { var NoopTracerProvider = /** @class */ (function () {
function NoopTracerProvider() { function NoopTracerProvider() {
} }
NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) { NoopTracerProvider.prototype.getTracer = function (_name, _version) {
return new NoopTracer_1.NoopTracer(); return new NoopTracer_1.NoopTracer();
}; };
return NoopTracerProvider; return NoopTracerProvider;
@ -5519,7 +5488,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
// //
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments // on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH; // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength); const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w'); const fd = fs.openSync(archivePath, 'w');
try { try {
@ -36293,9 +36263,9 @@ var ProxyTracerProvider = /** @class */ (function () {
/** /**
* Get a {@link ProxyTracer} * Get a {@link ProxyTracer}
*/ */
ProxyTracerProvider.prototype.getTracer = function (name, version, options) { ProxyTracerProvider.prototype.getTracer = function (name, version) {
var _a; var _a;
return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options)); return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version));
}; };
ProxyTracerProvider.prototype.getDelegate = function () { ProxyTracerProvider.prototype.getDelegate = function () {
var _a; var _a;
@ -36307,9 +36277,9 @@ var ProxyTracerProvider = /** @class */ (function () {
ProxyTracerProvider.prototype.setDelegate = function (delegate) { ProxyTracerProvider.prototype.setDelegate = function (delegate) {
this._delegate = delegate; this._delegate = delegate;
}; };
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) { ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {
var _a; var _a;
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);
}; };
return ProxyTracerProvider; return ProxyTracerProvider;
}()); }());
@ -36348,11 +36318,10 @@ var NOOP_TRACER = new NoopTracer_1.NoopTracer();
* Proxy tracer provided by the proxy tracer provider * Proxy tracer provided by the proxy tracer provider
*/ */
var ProxyTracer = /** @class */ (function () { var ProxyTracer = /** @class */ (function () {
function ProxyTracer(_provider, name, version, options) { function ProxyTracer(_provider, name, version) {
this._provider = _provider; this._provider = _provider;
this.name = name; this.name = name;
this.version = version; this.version = version;
this.options = options;
} }
ProxyTracer.prototype.startSpan = function (name, options, context) { ProxyTracer.prototype.startSpan = function (name, options, context) {
return this._getTracer().startSpan(name, options, context); return this._getTracer().startSpan(name, options, context);
@ -36369,7 +36338,7 @@ var ProxyTracer = /** @class */ (function () {
if (this._delegate) { if (this._delegate) {
return this._delegate; return this._delegate;
} }
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); var tracer = this._provider.getDelegateTracer(this.name, this.version);
if (!tracer) { if (!tracer) {
return NOOP_TRACER; return NOOP_TRACER;
} }
@ -37369,13 +37338,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.baggageEntryMetadataFromString = void 0; exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.baggageEntryMetadataFromString = void 0;
__exportStar(__webpack_require__(880), exports); __exportStar(__webpack_require__(880), exports);
var utils_1 = __webpack_require__(112); var utils_1 = __webpack_require__(112);
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } }); Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
__exportStar(__webpack_require__(452), exports); __exportStar(__webpack_require__(452), exports);
__exportStar(__webpack_require__(158), exports); __exportStar(__webpack_require__(158), exports);
__exportStar(__webpack_require__(907), exports);
__exportStar(__webpack_require__(893), exports); __exportStar(__webpack_require__(893), exports);
__exportStar(__webpack_require__(881), exports); __exportStar(__webpack_require__(881), exports);
__exportStar(__webpack_require__(906), exports); __exportStar(__webpack_require__(906), exports);
@ -37391,11 +37359,8 @@ __exportStar(__webpack_require__(220), exports);
__exportStar(__webpack_require__(932), exports); __exportStar(__webpack_require__(932), exports);
__exportStar(__webpack_require__(975), exports); __exportStar(__webpack_require__(975), exports);
__exportStar(__webpack_require__(207), exports); __exportStar(__webpack_require__(207), exports);
var utils_2 = __webpack_require__(42);
Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function () { return utils_2.createTraceState; } });
__exportStar(__webpack_require__(694), exports); __exportStar(__webpack_require__(694), exports);
__exportStar(__webpack_require__(695), exports); __exportStar(__webpack_require__(695), exports);
__exportStar(__webpack_require__(743), exports);
var spancontext_utils_1 = __webpack_require__(629); var spancontext_utils_1 = __webpack_require__(629);
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } }); Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } }); Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
@ -37463,8 +37428,7 @@ exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports
const core = __importStar(__webpack_require__(470)); const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(196); const constants_1 = __webpack_require__(196);
function isGhes() { function isGhes() {
const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); return false;
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
} }
exports.isGhes = isGhes; exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) { function isExactKeyMatch(key, cacheKey) {
@ -42117,58 +42081,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
/* 587 */, /* 587 */,
/* 588 */, /* 588 */,
/* 589 */, /* 589 */,
/* 590 */ /* 590 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateValue = exports.validateKey = void 0;
var VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
var VALID_KEY = "[a-z]" + VALID_KEY_CHAR_RANGE + "{0,255}";
var VALID_VENDOR_KEY = "[a-z0-9]" + VALID_KEY_CHAR_RANGE + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE + "{0,13}";
var VALID_KEY_REGEX = new RegExp("^(?:" + VALID_KEY + "|" + VALID_VENDOR_KEY + ")$");
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
/**
* Key is opaque string up to 256 characters printable. It MUST begin with a
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
* underscores _, dashes -, asterisks *, and forward slashes /.
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
* see https://www.w3.org/TR/trace-context/#key
*/
function validateKey(key) {
return VALID_KEY_REGEX.test(key);
}
exports.validateKey = validateKey;
/**
* Value is opaque string up to 256 characters printable ASCII RFC0020
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
*/
function validateValue(value) {
return (VALID_VALUE_BASE_REGEX.test(value) &&
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));
}
exports.validateValue = validateValue;
//# sourceMappingURL=tracestate-validators.js.map
/***/ }),
/* 591 */, /* 591 */,
/* 592 */, /* 592 */,
/* 593 */, /* 593 */,
@ -46533,6 +46446,15 @@ function checkKey(key) {
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
} }
} }
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/** /**
* Restores cache from keys * Restores cache from keys
* *
@ -46603,14 +46525,7 @@ function saveCache(paths, key, options) {
checkPaths(paths); checkPaths(paths);
checkKey(key); checkKey(key);
const compressionMethod = yield utils.getCompressionMethod(); const compressionMethod = yield utils.getCompressionMethod();
core.debug('Reserving Cache'); let cacheId = null;
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod
});
if (cacheId === -1) {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
}
core.debug(`Cache ID: ${cacheId}`);
const cachePaths = yield utils.resolvePaths(paths); const cachePaths = yield utils.resolvePaths(paths);
core.debug('Cache Paths:'); core.debug('Cache Paths:');
core.debug(`${JSON.stringify(cachePaths)}`); core.debug(`${JSON.stringify(cachePaths)}`);
@ -46622,12 +46537,29 @@ function saveCache(paths, key, options) {
if (core.isDebug()) { if (core.isDebug()) {
yield tar_1.listTar(archivePath, compressionMethod); yield tar_1.listTar(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
if (archiveFileSize > fileSizeLimit) { const cacheSize = archiveFileSize;
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); core.debug('Reserving Cache');
} let reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod,
cacheSize
});
// if(reserveCacheResponse?.statusCode === 400 && reserveCacheResponse?.result?.typeKey === "InvalidReserveCacheRequestException"){
// throw new ReserveCacheError(
// reserveCacheResponse?.result?.message ??
// `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
// )
// }
// if(reserveCacheResponse?.result?.cacheId){
// cacheId = reserveCacheResponse?.result?.cacheId
// }else{
// throw new ReserveCacheError(
// `Unable to reserve cache with key ${key}, another job may be creating this cache.`
// )
// }
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
core.debug(`Cache ID: ${cacheId}`);
core.debug(`Saving Cache (ID: ${cacheId})`); core.debug(`Saving Cache (ID: ${cacheId})`);
yield cacheHttpClient.saveCache(cacheId, archivePath, options); yield cacheHttpClient.saveCache(cacheId, archivePath, options);
} }
@ -47314,30 +47246,7 @@ exports.OidcClient = OidcClient;
//# sourceMappingURL=oidc-utils.js.map //# sourceMappingURL=oidc-utils.js.map
/***/ }), /***/ }),
/* 743 */ /* 743 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=tracer_options.js.map
/***/ }),
/* 744 */, /* 744 */,
/* 745 */, /* 745 */,
/* 746 */, /* 746 */,
@ -47434,117 +47343,7 @@ function async(callback)
/* 753 */, /* 753 */,
/* 754 */, /* 754 */,
/* 755 */, /* 755 */,
/* 756 */ /* 756 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TraceStateImpl = void 0;
var tracestate_validators_1 = __webpack_require__(590);
var MAX_TRACE_STATE_ITEMS = 32;
var MAX_TRACE_STATE_LEN = 512;
var LIST_MEMBERS_SEPARATOR = ',';
var LIST_MEMBER_KEY_VALUE_SPLITTER = '=';
/**
* TraceState must be a class and not a simple object type because of the spec
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
*
* Here is the list of allowed mutations:
* - New key-value pair should be added into the beginning of the list
* - The value of any key can be updated. Modified keys MUST be moved to the
* beginning of the list.
*/
var TraceStateImpl = /** @class */ (function () {
function TraceStateImpl(rawTraceState) {
this._internalState = new Map();
if (rawTraceState)
this._parse(rawTraceState);
}
TraceStateImpl.prototype.set = function (key, value) {
// TODO: Benchmark the different approaches(map vs list) and
// use the faster one.
var traceState = this._clone();
if (traceState._internalState.has(key)) {
traceState._internalState.delete(key);
}
traceState._internalState.set(key, value);
return traceState;
};
TraceStateImpl.prototype.unset = function (key) {
var traceState = this._clone();
traceState._internalState.delete(key);
return traceState;
};
TraceStateImpl.prototype.get = function (key) {
return this._internalState.get(key);
};
TraceStateImpl.prototype.serialize = function () {
var _this = this;
return this._keys()
.reduce(function (agg, key) {
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));
return agg;
}, [])
.join(LIST_MEMBERS_SEPARATOR);
};
TraceStateImpl.prototype._parse = function (rawTraceState) {
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
return;
this._internalState = rawTraceState
.split(LIST_MEMBERS_SEPARATOR)
.reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning
.reduce(function (agg, part) {
var listMember = part.trim(); // Optional Whitespace (OWS) handling
var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
if (i !== -1) {
var key = listMember.slice(0, i);
var value = listMember.slice(i + 1, part.length);
if (tracestate_validators_1.validateKey(key) && tracestate_validators_1.validateValue(value)) {
agg.set(key, value);
}
else {
// TODO: Consider to add warning log
}
}
return agg;
}, new Map());
// Because of the reverse() requirement, trunc must be done after map is created
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
this._internalState = new Map(Array.from(this._internalState.entries())
.reverse() // Use reverse same as original tracestate parse chain
.slice(0, MAX_TRACE_STATE_ITEMS));
}
};
TraceStateImpl.prototype._keys = function () {
return Array.from(this._internalState.keys()).reverse();
};
TraceStateImpl.prototype._clone = function () {
var traceState = new TraceStateImpl();
traceState._internalState = new Map(this._internalState);
return traceState;
};
return TraceStateImpl;
}());
exports.TraceStateImpl = TraceStateImpl;
//# sourceMappingURL=tracestate-impl.js.map
/***/ }),
/* 757 */, /* 757 */,
/* 758 */, /* 758 */,
/* 759 */, /* 759 */,
@ -49637,7 +49436,7 @@ module.exports = v4;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0; exports.VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js // this is autogenerated file, see scripts/version-update.js
exports.VERSION = '1.1.0'; exports.VERSION = '1.0.4';
//# sourceMappingURL=version.js.map //# sourceMappingURL=version.js.map
/***/ }), /***/ }),
@ -51769,7 +51568,9 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
return { return {
statusCode: error.statusCode, statusCode: error.statusCode,
result: null, result: null,
headers: {} headers: {},
message: error.message,
typeKey: error.result
}; };
} }
else { else {
@ -51860,30 +51661,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=attributes.js.map //# sourceMappingURL=attributes.js.map
/***/ }), /***/ }),
/* 907 */ /* 907 */,
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Attributes.js.map
/***/ }),
/* 908 */, /* 908 */,
/* 909 */, /* 909 */,
/* 910 */ /* 910 */

View File

@ -45,7 +45,7 @@
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies): Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.nuget/packages path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@ -54,10 +54,10 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
``` ```
Depending on the environment, huge packages might be pre-installed in the global cache folder. Depending on the environment, huge packages might be pre-installed in the global cache folder.
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns) With `actions/cache@v3` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.nuget/packages ~/.nuget/packages
@ -74,7 +74,7 @@ Or you could move the cache folder like below.
env: env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps: steps:
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ${{ github.workspace }}/.nuget/packages path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@ -87,7 +87,7 @@ steps:
### POSIX ### POSIX
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.dub path: ~/.dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }} key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
@ -98,7 +98,7 @@ steps:
### Windows ### Windows
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~\AppData\Local\dub path: ~\AppData\Local\dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }} key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
@ -111,7 +111,7 @@ steps:
### Linux ### Linux
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.deno ~/.deno
@ -122,7 +122,7 @@ steps:
### macOS ### macOS
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.deno ~/.deno
@ -133,7 +133,7 @@ steps:
### Windows ### Windows
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~\.deno ~\.deno
@ -145,7 +145,7 @@ steps:
## Elixir - Mix ## Elixir - Mix
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
deps deps
@ -160,7 +160,7 @@ steps:
### Linux ### Linux
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.cache/go-build ~/.cache/go-build
@ -173,7 +173,7 @@ steps:
### macOS ### macOS
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/Library/Caches/go-build ~/Library/Caches/go-build
@ -186,7 +186,7 @@ steps:
### Windows ### Windows
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~\AppData\Local\go-build ~\AppData\Local\go-build
@ -202,7 +202,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
```yaml ```yaml
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle - name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/.cabal/packages ~/.cabal/packages
@ -215,14 +215,14 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
## Haskell - Stack ## Haskell - Stack
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
name: Cache ~/.stack name: Cache ~/.stack
with: with:
path: ~/.stack path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }} key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-global- ${{ runner.os }}-stack-global-
- uses: actions/cache@v2 - uses: actions/cache@v3
name: Cache .stack-work name: Cache .stack-work
with: with:
path: .stack-work path: .stack-work
@ -236,7 +236,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
>Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons. >Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons.
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.gradle/caches ~/.gradle/caches
@ -250,7 +250,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
```yaml ```yaml
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@ -269,7 +269,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
### macOS and Ubuntu ### macOS and Ubuntu
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -284,7 +284,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
id: npm-cache id: npm-cache
run: | run: |
echo "::set-output name=dir::$(npm config get cache)" echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ${{ steps.npm-cache.outputs.dir }} path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -299,7 +299,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
id: npm-cache-dir id: npm-cache-dir
run: | run: |
echo "::set-output name=dir::$(npm config get cache)" echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2 - uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with: with:
path: ${{ steps.npm-cache-dir.outputs.dir }} path: ${{ steps.npm-cache-dir.outputs.dir }}
@ -312,7 +312,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
```yaml ```yaml
- name: restore lerna - name: restore lerna
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: **/node_modules path: **/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
@ -326,7 +326,7 @@ The yarn cache directory will depend on your operating system and version of `ya
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2 - uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@ -344,7 +344,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2 - uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@ -359,7 +359,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
```yaml ```yaml
- name: Restore Cache - name: Restore Cache
id: restore-cache id: restore-cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: _export path: _export
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }} key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
@ -388,7 +388,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
id: composer-cache id: composer-cache
run: | run: |
echo "::set-output name=dir::$(composer config cache-files-dir)" echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ${{ steps.composer-cache.outputs.dir }} path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@ -409,7 +409,7 @@ Locations:
### Simple example ### Simple example
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@ -422,7 +422,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
### Multiple OS's in a workflow ### Multiple OS's in a workflow
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
if: startsWith(runner.os, 'Linux') if: startsWith(runner.os, 'Linux')
with: with:
path: ~/.cache/pip path: ~/.cache/pip
@ -430,7 +430,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- uses: actions/cache@v2 - uses: actions/cache@v3
if: startsWith(runner.os, 'macOS') if: startsWith(runner.os, 'macOS')
with: with:
path: ~/Library/Caches/pip path: ~/Library/Caches/pip
@ -438,7 +438,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- uses: actions/cache@v2 - uses: actions/cache@v3
if: startsWith(runner.os, 'Windows') if: startsWith(runner.os, 'Windows')
with: with:
path: ~\AppData\Local\pip\Cache path: ~\AppData\Local\pip\Cache
@ -464,7 +464,7 @@ jobs:
- os: windows-latest - os: windows-latest
path: ~\AppData\Local\pip\Cache path: ~\AppData\Local\pip\Cache
steps: steps:
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ${{ matrix.path }} path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@ -482,7 +482,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)" echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache - name: pip cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ${{ steps.pip-cache.outputs.dir }} path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@ -500,7 +500,7 @@ jobs:
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.local/share/virtualenvs path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }} key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
@ -527,7 +527,7 @@ For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment
cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "") cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
shell: Rscript {0} shell: Rscript {0}
- name: Restore Renv package cache - name: Restore Renv package cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ${{ env.RENV_PATHS_ROOT }} path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }} key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
@ -553,7 +553,7 @@ whenever possible:
## Rust - Cargo ## Rust - Cargo
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.cargo/bin/ ~/.cargo/bin/
@ -568,7 +568,7 @@ whenever possible:
```yaml ```yaml
- name: Cache SBT - name: Cache SBT
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/.ivy2/cache ~/.ivy2/cache
@ -579,7 +579,7 @@ whenever possible:
## Swift, Objective-C - Carthage ## Swift, Objective-C - Carthage
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: Carthage path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }} key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
@ -590,7 +590,7 @@ whenever possible:
## Swift, Objective-C - CocoaPods ## Swift, Objective-C - CocoaPods
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: Pods path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
@ -601,7 +601,7 @@ whenever possible:
## Swift - Swift Package Manager ## Swift - Swift Package Manager
```yaml ```yaml
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: .build path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}

11
package-lock.json generated
View File

@ -5,9 +5,8 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/cache": { "@actions/cache": {
"version": "1.0.10", "version": "file:actions-cache-2.6.0.tgz",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.10.tgz", "integrity": "sha512-B4nmafK6ta7svnwFPDTWK+I5M9Yx5ZQeVau0u4viwnmHrFjLg8zYOL1eNEKOGM/7GXkRAN2jiyaXu8jW419BYw==",
"integrity": "sha512-8l9A54RXsPHbHs4Tu0DGqTyE5cguvq3xO9H0ohbLa5zbL2Z4dh9lxnjQn2xojsPQr4WnEVgbaVZpc1tlhehQGw==",
"requires": { "requires": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
@ -1186,9 +1185,9 @@
} }
}, },
"@opentelemetry/api": { "@opentelemetry/api": {
"version": "1.1.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz",
"integrity": "sha512-hf+3bwuBwtXsugA2ULBc95qxrOqP2pOekLz34BJhcAKawt94vfeNyUKpYc0lZQ/3sCP6LqRa7UAdHA7i5UODzQ==" "integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog=="
}, },
"@sinonjs/commons": { "@sinonjs/commons": {
"version": "1.8.3", "version": "1.8.3",

View File

@ -23,7 +23,7 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^1.0.10", "@actions/cache": "file:actions-cache-2.6.0.tgz",
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2" "@actions/io": "^1.1.2"

View File

@ -3,10 +3,7 @@ import * as core from "@actions/core";
import { Outputs, RefKey, State } from "../constants"; import { Outputs, RefKey, State } from "../constants";
export function isGhes(): boolean { export function isGhes(): boolean {
const ghUrl = new URL( return false;
process.env["GITHUB_SERVER_URL"] || "https://github.com"
);
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
} }
export function isExactKeyMatch(key: string, cacheKey?: string): boolean { export function isExactKeyMatch(key: string, cacheKey?: string): boolean {