mirror of
https://github.com/actions/cache.git
synced 2026-06-23 17:43:50 +08:00
Compare commits
23 Commits
v4.2.2
...
47a856f495
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a856f495 | ||
|
|
783accdc1c | ||
|
|
6905c11681 | ||
|
|
c5c1c31345 | ||
|
|
91afe36e0a | ||
|
|
480d890516 | ||
|
|
5a3ec84eff | ||
|
|
7de21022a7 | ||
|
|
76d40dd347 | ||
|
|
76dd5eb692 | ||
|
|
8c80c27c5e | ||
|
|
45cfd0e7ff | ||
|
|
edd449b9cf | ||
|
|
0576707e37 | ||
|
|
3105dc9754 | ||
|
|
9450d42d15 | ||
|
|
7d05b27fb9 | ||
|
|
507b84c6a6 | ||
|
|
f248408e15 | ||
|
|
c30eb5542e | ||
|
|
5b6ae99d8b | ||
|
|
eca7c65a55 | ||
|
|
1b5d75f5cf |
2
.licenses/npm/@actions/cache.dep.yml
generated
2
.licenses/npm/@actions/cache.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/cache"
|
name: "@actions/cache"
|
||||||
version: 4.0.2
|
version: 4.0.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions cache lib
|
summary: Actions cache lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir
|
|||||||
* `cache-hit` - A string value to indicate an exact match was found for the key.
|
* `cache-hit` - A string value to indicate an exact match was found for the key.
|
||||||
* If there's a cache hit, this will be 'true' or 'false' to indicate if there's an exact match for `key`.
|
* If there's a cache hit, this will be 'true' or 'false' to indicate if there's an exact match for `key`.
|
||||||
* If there's a cache miss, this will be an empty string.
|
* If there's a cache miss, this will be an empty string.
|
||||||
|
* `cache-primary-key` - Cache primary key passed in the input to use in subsequent steps of the workflow.
|
||||||
|
* `cache-matched-key` - Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys.
|
||||||
|
|
||||||
See [Skipping steps based on cache-hit](#skipping-steps-based-on-cache-hit) for info on using this output
|
See [Skipping steps based on cache-hit](#skipping-steps-based-on-cache-hit) for info on using this output
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# Releases
|
# Releases
|
||||||
|
|
||||||
|
### 4.2.3
|
||||||
|
|
||||||
|
- Bump `@actions/cache` to v4.0.3 (obfuscates SAS token in debug logs for cache entries)
|
||||||
|
|
||||||
### 4.2.2
|
### 4.2.2
|
||||||
|
|
||||||
- Bump `@actions/cache` to v4.0.2
|
- Bump `@actions/cache` to v4.0.2
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ test("restore with cache found for key", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -173,8 +173,10 @@ test("restore with cache found for key", async () => {
|
|||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key);
|
||||||
expect(stateMock).toHaveBeenCalledTimes(2);
|
expect(stateMock).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
@@ -194,7 +196,7 @@ test("restore with cache found for restore key", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -218,8 +220,10 @@ test("restore with cache found for restore key", async () => {
|
|||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", restoreKey);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", restoreKey);
|
||||||
expect(stateMock).toHaveBeenCalledTimes(2);
|
expect(stateMock).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: ${restoreKey}`
|
`Cache restored from key: ${restoreKey}`
|
||||||
);
|
);
|
||||||
@@ -239,7 +243,7 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
|
|||||||
|
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -260,7 +264,8 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
|
expect(setOutputMock).toHaveBeenCalledTimes(1);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
|
||||||
expect(failedMock).toHaveBeenCalledWith(
|
expect(failedMock).toHaveBeenCalledWith(
|
||||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
||||||
@@ -282,7 +287,7 @@ test("restore when fail on cache miss is enabled and primary key doesn't match r
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -306,8 +311,10 @@ test("restore when fail on cache miss is enabled and primary key doesn't match r
|
|||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", restoreKey);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", restoreKey);
|
||||||
expect(stateMock).toHaveBeenCalledTimes(2);
|
expect(stateMock).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: ${restoreKey}`
|
`Cache restored from key: ${restoreKey}`
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ test("restore on GHES with AC available ", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -133,8 +133,10 @@ test("restore on GHES with AC available ", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
@@ -334,7 +336,7 @@ test("restore with cache found for key", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -355,8 +357,10 @@ test("restore with cache found for key", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
@@ -376,7 +380,7 @@ test("restore with cache found for restore key", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -397,8 +401,10 @@ test("restore with cache found for restore key", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: ${restoreKey}`
|
`Cache restored from key: ${restoreKey}`
|
||||||
);
|
);
|
||||||
@@ -417,7 +423,7 @@ test("restore with lookup-only set", async () => {
|
|||||||
const infoMock = jest.spyOn(core, "info");
|
const infoMock = jest.spyOn(core, "info");
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
const stateMock = jest.spyOn(core, "saveState");
|
const stateMock = jest.spyOn(core, "saveState");
|
||||||
const setCacheHitOutputMock = jest.spyOn(core, "setOutput");
|
const setOutputMock = jest.spyOn(core, "setOutput");
|
||||||
const restoreCacheMock = jest
|
const restoreCacheMock = jest
|
||||||
.spyOn(cache, "restoreCache")
|
.spyOn(cache, "restoreCache")
|
||||||
.mockImplementationOnce(() => {
|
.mockImplementationOnce(() => {
|
||||||
@@ -441,8 +447,10 @@ test("restore with lookup-only set", async () => {
|
|||||||
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key);
|
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key);
|
||||||
expect(stateMock).toHaveBeenCalledTimes(2);
|
expect(stateMock).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setOutputMock).toHaveBeenCalledTimes(3);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
expect(setOutputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(setOutputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
`Cache found and can be restored from key: ${key}`
|
`Cache found and can be restored from key: ${key}`
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ test("StateProvider saves states", async () => {
|
|||||||
expect(cacheStateValue).toBe(cacheMatchedKey);
|
expect(cacheStateValue).toBe(cacheMatchedKey);
|
||||||
expect(getStateMock).toHaveBeenCalledTimes(2);
|
expect(getStateMock).toHaveBeenCalledTimes(2);
|
||||||
expect(saveStateMock).toHaveBeenCalledTimes(2);
|
expect(saveStateMock).toHaveBeenCalledTimes(2);
|
||||||
expect(setOutputMock).toHaveBeenCalledTimes(0);
|
expect(setOutputMock).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("NullStateProvider saves outputs", async () => {
|
test("NullStateProvider saves outputs", async () => {
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||||
|
cache-primary-key:
|
||||||
|
description: 'A resolved cache key for which cache match was attempted'
|
||||||
|
cache-matched-key:
|
||||||
|
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
main: 'dist/restore/index.js'
|
main: 'dist/restore/index.js'
|
||||||
|
|||||||
104
dist/restore-only/index.js
vendored
104
dist/restore-only/index.js
vendored
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
};
|
};
|
||||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
core.debug(`Cache not found for keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
core.info(`Cache hit for: ${request.key}`);
|
||||||
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(8299);
|
|||||||
const auth_1 = __nccwpck_require__(4552);
|
const auth_1 = __nccwpck_require__(4552);
|
||||||
const http_client_1 = __nccwpck_require__(4844);
|
const http_client_1 = __nccwpck_require__(4844);
|
||||||
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
||||||
|
const util_1 = __nccwpck_require__(7564);
|
||||||
/**
|
/**
|
||||||
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
||||||
*
|
*
|
||||||
@@ -2263,6 +2264,7 @@ class CacheServiceClient {
|
|||||||
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
||||||
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
||||||
const body = JSON.parse(rawBody);
|
const body = JSON.parse(rawBody);
|
||||||
|
(0, util_1.maskSecretUrls)(body);
|
||||||
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
||||||
if (this.isSuccessStatusCode(statusCode)) {
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
return { response, body };
|
return { response, body };
|
||||||
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7564:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.maskSecretUrls = exports.maskSigUrl = void 0;
|
||||||
|
const core_1 = __nccwpck_require__(7484);
|
||||||
|
/**
|
||||||
|
* Masks the `sig` parameter in a URL and sets it as a secret.
|
||||||
|
*
|
||||||
|
* @param url - The URL containing the signature parameter to mask
|
||||||
|
* @remarks
|
||||||
|
* This function attempts to parse the provided URL and identify the 'sig' query parameter.
|
||||||
|
* If found, it registers both the raw and URL-encoded signature values as secrets using
|
||||||
|
* the Actions `setSecret` API, which prevents them from being displayed in logs.
|
||||||
|
*
|
||||||
|
* The function handles errors gracefully if URL parsing fails, logging them as debug messages.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Mask a signature in an Azure SAS token URL
|
||||||
|
* maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01');
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSigUrl(url) {
|
||||||
|
if (!url)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
const parsedUrl = new URL(url);
|
||||||
|
const signature = parsedUrl.searchParams.get('sig');
|
||||||
|
if (signature) {
|
||||||
|
(0, core_1.setSecret)(signature);
|
||||||
|
(0, core_1.setSecret)(encodeURIComponent(signature));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
(0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSigUrl = maskSigUrl;
|
||||||
|
/**
|
||||||
|
* Masks sensitive information in URLs containing signature parameters.
|
||||||
|
* Currently supports masking 'sig' parameters in the 'signed_upload_url'
|
||||||
|
* and 'signed_download_url' properties of the provided object.
|
||||||
|
*
|
||||||
|
* @param body - The object should contain a signature
|
||||||
|
* @remarks
|
||||||
|
* This function extracts URLs from the object properties and calls maskSigUrl
|
||||||
|
* on each one to redact sensitive signature information. The function doesn't
|
||||||
|
* modify the original object; it only marks the signatures as secrets for
|
||||||
|
* logging purposes.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* const responseBody = {
|
||||||
|
* signed_upload_url: 'https://blob.core.windows.net/?sig=abc123',
|
||||||
|
* signed_download_url: 'https://blob.core/windows.net/?sig=def456'
|
||||||
|
* };
|
||||||
|
* maskSecretUrls(responseBody);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSecretUrls(body) {
|
||||||
|
if (typeof body !== 'object' || body === null) {
|
||||||
|
(0, core_1.debug)('body is not an object or is null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ('signed_upload_url' in body &&
|
||||||
|
typeof body.signed_upload_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_upload_url);
|
||||||
|
}
|
||||||
|
if ('signed_download_url' in body &&
|
||||||
|
typeof body.signed_download_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_download_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSecretUrls = maskSecretUrls;
|
||||||
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5321:
|
/***/ 5321:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
@@ -65031,21 +65114,22 @@ class StateProviderBase {
|
|||||||
class StateProvider extends StateProviderBase {
|
class StateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.setState = core.saveState;
|
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||||
this.getState = core.getState;
|
this.getState = core.getState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.StateProvider = StateProvider;
|
exports.StateProvider = StateProvider;
|
||||||
|
const stateToOutputMap = new Map([
|
||||||
|
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||||
|
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||||
|
]);
|
||||||
|
function stateToOutput(key, value) {
|
||||||
|
core.setOutput(stateToOutputMap.get(key), value);
|
||||||
|
}
|
||||||
class NullStateProvider extends StateProviderBase {
|
class NullStateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.stateToOutputMap = new Map([
|
this.setState = stateToOutput;
|
||||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
|
||||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
|
||||||
]);
|
|
||||||
this.setState = (key, value) => {
|
|
||||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
this.getState = (key) => "";
|
this.getState = (key) => "";
|
||||||
}
|
}
|
||||||
@@ -65317,7 +65401,7 @@ module.exports = require("zlib");
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
104
dist/restore/index.js
vendored
104
dist/restore/index.js
vendored
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
};
|
};
|
||||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
core.debug(`Cache not found for keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
core.info(`Cache hit for: ${request.key}`);
|
||||||
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(8299);
|
|||||||
const auth_1 = __nccwpck_require__(4552);
|
const auth_1 = __nccwpck_require__(4552);
|
||||||
const http_client_1 = __nccwpck_require__(4844);
|
const http_client_1 = __nccwpck_require__(4844);
|
||||||
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
||||||
|
const util_1 = __nccwpck_require__(7564);
|
||||||
/**
|
/**
|
||||||
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
||||||
*
|
*
|
||||||
@@ -2263,6 +2264,7 @@ class CacheServiceClient {
|
|||||||
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
||||||
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
||||||
const body = JSON.parse(rawBody);
|
const body = JSON.parse(rawBody);
|
||||||
|
(0, util_1.maskSecretUrls)(body);
|
||||||
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
||||||
if (this.isSuccessStatusCode(statusCode)) {
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
return { response, body };
|
return { response, body };
|
||||||
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7564:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.maskSecretUrls = exports.maskSigUrl = void 0;
|
||||||
|
const core_1 = __nccwpck_require__(7484);
|
||||||
|
/**
|
||||||
|
* Masks the `sig` parameter in a URL and sets it as a secret.
|
||||||
|
*
|
||||||
|
* @param url - The URL containing the signature parameter to mask
|
||||||
|
* @remarks
|
||||||
|
* This function attempts to parse the provided URL and identify the 'sig' query parameter.
|
||||||
|
* If found, it registers both the raw and URL-encoded signature values as secrets using
|
||||||
|
* the Actions `setSecret` API, which prevents them from being displayed in logs.
|
||||||
|
*
|
||||||
|
* The function handles errors gracefully if URL parsing fails, logging them as debug messages.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Mask a signature in an Azure SAS token URL
|
||||||
|
* maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01');
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSigUrl(url) {
|
||||||
|
if (!url)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
const parsedUrl = new URL(url);
|
||||||
|
const signature = parsedUrl.searchParams.get('sig');
|
||||||
|
if (signature) {
|
||||||
|
(0, core_1.setSecret)(signature);
|
||||||
|
(0, core_1.setSecret)(encodeURIComponent(signature));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
(0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSigUrl = maskSigUrl;
|
||||||
|
/**
|
||||||
|
* Masks sensitive information in URLs containing signature parameters.
|
||||||
|
* Currently supports masking 'sig' parameters in the 'signed_upload_url'
|
||||||
|
* and 'signed_download_url' properties of the provided object.
|
||||||
|
*
|
||||||
|
* @param body - The object should contain a signature
|
||||||
|
* @remarks
|
||||||
|
* This function extracts URLs from the object properties and calls maskSigUrl
|
||||||
|
* on each one to redact sensitive signature information. The function doesn't
|
||||||
|
* modify the original object; it only marks the signatures as secrets for
|
||||||
|
* logging purposes.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* const responseBody = {
|
||||||
|
* signed_upload_url: 'https://blob.core.windows.net/?sig=abc123',
|
||||||
|
* signed_download_url: 'https://blob.core/windows.net/?sig=def456'
|
||||||
|
* };
|
||||||
|
* maskSecretUrls(responseBody);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSecretUrls(body) {
|
||||||
|
if (typeof body !== 'object' || body === null) {
|
||||||
|
(0, core_1.debug)('body is not an object or is null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ('signed_upload_url' in body &&
|
||||||
|
typeof body.signed_upload_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_upload_url);
|
||||||
|
}
|
||||||
|
if ('signed_download_url' in body &&
|
||||||
|
typeof body.signed_download_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_download_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSecretUrls = maskSecretUrls;
|
||||||
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5321:
|
/***/ 5321:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
@@ -65031,21 +65114,22 @@ class StateProviderBase {
|
|||||||
class StateProvider extends StateProviderBase {
|
class StateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.setState = core.saveState;
|
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||||
this.getState = core.getState;
|
this.getState = core.getState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.StateProvider = StateProvider;
|
exports.StateProvider = StateProvider;
|
||||||
|
const stateToOutputMap = new Map([
|
||||||
|
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||||
|
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||||
|
]);
|
||||||
|
function stateToOutput(key, value) {
|
||||||
|
core.setOutput(stateToOutputMap.get(key), value);
|
||||||
|
}
|
||||||
class NullStateProvider extends StateProviderBase {
|
class NullStateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.stateToOutputMap = new Map([
|
this.setState = stateToOutput;
|
||||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
|
||||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
|
||||||
]);
|
|
||||||
this.setState = (key, value) => {
|
|
||||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
this.getState = (key) => "";
|
this.getState = (key) => "";
|
||||||
}
|
}
|
||||||
@@ -65317,7 +65401,7 @@ module.exports = require("zlib");
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
104
dist/save-only/index.js
vendored
104
dist/save-only/index.js
vendored
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
};
|
};
|
||||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
core.debug(`Cache not found for keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
core.info(`Cache hit for: ${request.key}`);
|
||||||
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(8299);
|
|||||||
const auth_1 = __nccwpck_require__(4552);
|
const auth_1 = __nccwpck_require__(4552);
|
||||||
const http_client_1 = __nccwpck_require__(4844);
|
const http_client_1 = __nccwpck_require__(4844);
|
||||||
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
||||||
|
const util_1 = __nccwpck_require__(7564);
|
||||||
/**
|
/**
|
||||||
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
||||||
*
|
*
|
||||||
@@ -2263,6 +2264,7 @@ class CacheServiceClient {
|
|||||||
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
||||||
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
||||||
const body = JSON.parse(rawBody);
|
const body = JSON.parse(rawBody);
|
||||||
|
(0, util_1.maskSecretUrls)(body);
|
||||||
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
||||||
if (this.isSuccessStatusCode(statusCode)) {
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
return { response, body };
|
return { response, body };
|
||||||
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7564:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.maskSecretUrls = exports.maskSigUrl = void 0;
|
||||||
|
const core_1 = __nccwpck_require__(7484);
|
||||||
|
/**
|
||||||
|
* Masks the `sig` parameter in a URL and sets it as a secret.
|
||||||
|
*
|
||||||
|
* @param url - The URL containing the signature parameter to mask
|
||||||
|
* @remarks
|
||||||
|
* This function attempts to parse the provided URL and identify the 'sig' query parameter.
|
||||||
|
* If found, it registers both the raw and URL-encoded signature values as secrets using
|
||||||
|
* the Actions `setSecret` API, which prevents them from being displayed in logs.
|
||||||
|
*
|
||||||
|
* The function handles errors gracefully if URL parsing fails, logging them as debug messages.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Mask a signature in an Azure SAS token URL
|
||||||
|
* maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01');
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSigUrl(url) {
|
||||||
|
if (!url)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
const parsedUrl = new URL(url);
|
||||||
|
const signature = parsedUrl.searchParams.get('sig');
|
||||||
|
if (signature) {
|
||||||
|
(0, core_1.setSecret)(signature);
|
||||||
|
(0, core_1.setSecret)(encodeURIComponent(signature));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
(0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSigUrl = maskSigUrl;
|
||||||
|
/**
|
||||||
|
* Masks sensitive information in URLs containing signature parameters.
|
||||||
|
* Currently supports masking 'sig' parameters in the 'signed_upload_url'
|
||||||
|
* and 'signed_download_url' properties of the provided object.
|
||||||
|
*
|
||||||
|
* @param body - The object should contain a signature
|
||||||
|
* @remarks
|
||||||
|
* This function extracts URLs from the object properties and calls maskSigUrl
|
||||||
|
* on each one to redact sensitive signature information. The function doesn't
|
||||||
|
* modify the original object; it only marks the signatures as secrets for
|
||||||
|
* logging purposes.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* const responseBody = {
|
||||||
|
* signed_upload_url: 'https://blob.core.windows.net/?sig=abc123',
|
||||||
|
* signed_download_url: 'https://blob.core/windows.net/?sig=def456'
|
||||||
|
* };
|
||||||
|
* maskSecretUrls(responseBody);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSecretUrls(body) {
|
||||||
|
if (typeof body !== 'object' || body === null) {
|
||||||
|
(0, core_1.debug)('body is not an object or is null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ('signed_upload_url' in body &&
|
||||||
|
typeof body.signed_upload_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_upload_url);
|
||||||
|
}
|
||||||
|
if ('signed_download_url' in body &&
|
||||||
|
typeof body.signed_download_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_download_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSecretUrls = maskSecretUrls;
|
||||||
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5321:
|
/***/ 5321:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
@@ -65044,21 +65127,22 @@ class StateProviderBase {
|
|||||||
class StateProvider extends StateProviderBase {
|
class StateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.setState = core.saveState;
|
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||||
this.getState = core.getState;
|
this.getState = core.getState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.StateProvider = StateProvider;
|
exports.StateProvider = StateProvider;
|
||||||
|
const stateToOutputMap = new Map([
|
||||||
|
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||||
|
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||||
|
]);
|
||||||
|
function stateToOutput(key, value) {
|
||||||
|
core.setOutput(stateToOutputMap.get(key), value);
|
||||||
|
}
|
||||||
class NullStateProvider extends StateProviderBase {
|
class NullStateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.stateToOutputMap = new Map([
|
this.setState = stateToOutput;
|
||||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
|
||||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
|
||||||
]);
|
|
||||||
this.setState = (key, value) => {
|
|
||||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
this.getState = (key) => "";
|
this.getState = (key) => "";
|
||||||
}
|
}
|
||||||
@@ -65330,7 +65414,7 @@ module.exports = require("zlib");
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
104
dist/save/index.js
vendored
104
dist/save/index.js
vendored
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
};
|
};
|
||||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
core.debug(`Cache not found for keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
core.info(`Cache hit for: ${request.key}`);
|
||||||
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(8299);
|
|||||||
const auth_1 = __nccwpck_require__(4552);
|
const auth_1 = __nccwpck_require__(4552);
|
||||||
const http_client_1 = __nccwpck_require__(4844);
|
const http_client_1 = __nccwpck_require__(4844);
|
||||||
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
const cache_twirp_client_1 = __nccwpck_require__(1486);
|
||||||
|
const util_1 = __nccwpck_require__(7564);
|
||||||
/**
|
/**
|
||||||
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
|
||||||
*
|
*
|
||||||
@@ -2263,6 +2264,7 @@ class CacheServiceClient {
|
|||||||
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
(0, core_1.debug)(`[Response] - ${response.message.statusCode}`);
|
||||||
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
(0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
|
||||||
const body = JSON.parse(rawBody);
|
const body = JSON.parse(rawBody);
|
||||||
|
(0, util_1.maskSecretUrls)(body);
|
||||||
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
(0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`);
|
||||||
if (this.isSuccessStatusCode(statusCode)) {
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
return { response, body };
|
return { response, body };
|
||||||
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7564:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.maskSecretUrls = exports.maskSigUrl = void 0;
|
||||||
|
const core_1 = __nccwpck_require__(7484);
|
||||||
|
/**
|
||||||
|
* Masks the `sig` parameter in a URL and sets it as a secret.
|
||||||
|
*
|
||||||
|
* @param url - The URL containing the signature parameter to mask
|
||||||
|
* @remarks
|
||||||
|
* This function attempts to parse the provided URL and identify the 'sig' query parameter.
|
||||||
|
* If found, it registers both the raw and URL-encoded signature values as secrets using
|
||||||
|
* the Actions `setSecret` API, which prevents them from being displayed in logs.
|
||||||
|
*
|
||||||
|
* The function handles errors gracefully if URL parsing fails, logging them as debug messages.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Mask a signature in an Azure SAS token URL
|
||||||
|
* maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01');
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSigUrl(url) {
|
||||||
|
if (!url)
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
const parsedUrl = new URL(url);
|
||||||
|
const signature = parsedUrl.searchParams.get('sig');
|
||||||
|
if (signature) {
|
||||||
|
(0, core_1.setSecret)(signature);
|
||||||
|
(0, core_1.setSecret)(encodeURIComponent(signature));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
(0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSigUrl = maskSigUrl;
|
||||||
|
/**
|
||||||
|
* Masks sensitive information in URLs containing signature parameters.
|
||||||
|
* Currently supports masking 'sig' parameters in the 'signed_upload_url'
|
||||||
|
* and 'signed_download_url' properties of the provided object.
|
||||||
|
*
|
||||||
|
* @param body - The object should contain a signature
|
||||||
|
* @remarks
|
||||||
|
* This function extracts URLs from the object properties and calls maskSigUrl
|
||||||
|
* on each one to redact sensitive signature information. The function doesn't
|
||||||
|
* modify the original object; it only marks the signatures as secrets for
|
||||||
|
* logging purposes.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* const responseBody = {
|
||||||
|
* signed_upload_url: 'https://blob.core.windows.net/?sig=abc123',
|
||||||
|
* signed_download_url: 'https://blob.core/windows.net/?sig=def456'
|
||||||
|
* };
|
||||||
|
* maskSecretUrls(responseBody);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
function maskSecretUrls(body) {
|
||||||
|
if (typeof body !== 'object' || body === null) {
|
||||||
|
(0, core_1.debug)('body is not an object or is null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ('signed_upload_url' in body &&
|
||||||
|
typeof body.signed_upload_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_upload_url);
|
||||||
|
}
|
||||||
|
if ('signed_download_url' in body &&
|
||||||
|
typeof body.signed_download_url === 'string') {
|
||||||
|
maskSigUrl(body.signed_download_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.maskSecretUrls = maskSecretUrls;
|
||||||
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5321:
|
/***/ 5321:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
@@ -65044,21 +65127,22 @@ class StateProviderBase {
|
|||||||
class StateProvider extends StateProviderBase {
|
class StateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.setState = core.saveState;
|
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||||
this.getState = core.getState;
|
this.getState = core.getState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.StateProvider = StateProvider;
|
exports.StateProvider = StateProvider;
|
||||||
|
const stateToOutputMap = new Map([
|
||||||
|
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||||
|
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||||
|
]);
|
||||||
|
function stateToOutput(key, value) {
|
||||||
|
core.setOutput(stateToOutputMap.get(key), value);
|
||||||
|
}
|
||||||
class NullStateProvider extends StateProviderBase {
|
class NullStateProvider extends StateProviderBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.stateToOutputMap = new Map([
|
this.setState = stateToOutput;
|
||||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
|
||||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
|
||||||
]);
|
|
||||||
this.setState = (key, value) => {
|
|
||||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
this.getState = (key) => "";
|
this.getState = (key) => "";
|
||||||
}
|
}
|
||||||
@@ -65330,7 +65414,7 @@ module.exports = require("zlib");
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "4.2.2",
|
"version": "4.2.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "4.2.2",
|
"version": "4.2.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.2",
|
"@actions/cache": "^4.0.3",
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.3"
|
"@actions/io": "^1.1.3"
|
||||||
@@ -36,9 +36,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache": {
|
"node_modules/@actions/cache": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.3.tgz",
|
||||||
"integrity": "sha512-cBr7JL1q+JKjbBd3w3SZN5OQ1Xg+/D8QLMcE7MpgpghZlL4biBO0ZEeraoTxCZyfN0YY0dxXlLgsgGv/sT5BTg==",
|
"integrity": "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
@@ -9600,9 +9600,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": {
|
"@actions/cache": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.3.tgz",
|
||||||
"integrity": "sha512-cBr7JL1q+JKjbBd3w3SZN5OQ1Xg+/D8QLMcE7MpgpghZlL4biBO0ZEeraoTxCZyfN0YY0dxXlLgsgGv/sT5BTg==",
|
"integrity": "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "4.2.2",
|
"version": "4.2.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Cache dependencies and build outputs",
|
"description": "Cache dependencies and build outputs",
|
||||||
"main": "dist/restore/index.js",
|
"main": "dist/restore/index.js",
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.2",
|
"@actions/cache": "^4.0.3",
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.3"
|
"@actions/io": "^1.1.3"
|
||||||
|
|||||||
@@ -28,19 +28,22 @@ class StateProviderBase implements IStateProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class StateProvider extends StateProviderBase {
|
export class StateProvider extends StateProviderBase {
|
||||||
setState = core.saveState;
|
setState = (key: string, value: string) => {
|
||||||
|
core.saveState(key, value);
|
||||||
|
stateToOutput(key, value);
|
||||||
|
};
|
||||||
getState = core.getState;
|
getState = core.getState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const stateToOutputMap = new Map<string, string>([
|
||||||
|
[State.CacheMatchedKey, Outputs.CacheMatchedKey],
|
||||||
|
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
|
||||||
|
]);
|
||||||
|
function stateToOutput(key: string, value: string) {
|
||||||
|
core.setOutput(stateToOutputMap.get(key) as string, value);
|
||||||
|
}
|
||||||
export class NullStateProvider extends StateProviderBase {
|
export class NullStateProvider extends StateProviderBase {
|
||||||
stateToOutputMap = new Map<string, string>([
|
setState = stateToOutput;
|
||||||
[State.CacheMatchedKey, Outputs.CacheMatchedKey],
|
|
||||||
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
|
|
||||||
]);
|
|
||||||
|
|
||||||
setState = (key: string, value: string) => {
|
|
||||||
core.setOutput(this.stateToOutputMap.get(key) as string, value);
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
getState = (key: string) => "";
|
getState = (key: string) => "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user