mirror of
https://github.com/rharkor/caching-for-turbo.git
synced 2025-06-11 18:20:24 +09:00
fix: ci
This commit is contained in:
parent
eb287d233e
commit
dee28cf0df
3 changed files with 7 additions and 15 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
@ -122839,11 +122839,6 @@ function getCacheClient() {
|
||||||
if (!env_1.env.valid) {
|
if (!env_1.env.valid) {
|
||||||
throw new Error('Cache API env vars are not set');
|
throw new Error('Cache API env vars are not set');
|
||||||
}
|
}
|
||||||
const baseURL = `${env_1.env.ACTIONS_CACHE_URL.replace(/\/$/, '')}/_apis/artifactcache`;
|
|
||||||
const headers = new Headers({
|
|
||||||
Authorization: `Bearer ${env_1.env.ACTIONS_RUNTIME_TOKEN}`,
|
|
||||||
Accept: 'application/json;api-version=6.0-preview.1'
|
|
||||||
});
|
|
||||||
const reserve = async (key, version) => {
|
const reserve = async (key, version) => {
|
||||||
try {
|
try {
|
||||||
const reserveCacheResponse = await cacheHttpClient.reserveCache(key, [
|
const reserveCacheResponse = await cacheHttpClient.reserveCache(key, [
|
||||||
|
@ -122890,7 +122885,6 @@ function getCacheClient() {
|
||||||
const query = async (keys, version) => {
|
const query = async (keys, version) => {
|
||||||
try {
|
try {
|
||||||
const queryCacheResponse = await cacheHttpClient.getCacheEntry([keys], [version]);
|
const queryCacheResponse = await cacheHttpClient.getCacheEntry([keys], [version]);
|
||||||
core.info(`Cache result ${queryCacheResponse}`);
|
|
||||||
if (queryCacheResponse?.archiveLocation) {
|
if (queryCacheResponse?.archiveLocation) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
@ -122901,7 +122895,9 @@ function getCacheClient() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return handleFetchError('Unable to query cache')(queryCacheResponse);
|
return {
|
||||||
|
success: false
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
10
src/lib/cache/utils.ts
vendored
10
src/lib/cache/utils.ts
vendored
|
@ -34,11 +34,6 @@ export function getCacheClient() {
|
||||||
if (!env.valid) {
|
if (!env.valid) {
|
||||||
throw new Error('Cache API env vars are not set')
|
throw new Error('Cache API env vars are not set')
|
||||||
}
|
}
|
||||||
const baseURL = `${env.ACTIONS_CACHE_URL.replace(/\/$/, '')}/_apis/artifactcache`
|
|
||||||
const headers = new Headers({
|
|
||||||
Authorization: `Bearer ${env.ACTIONS_RUNTIME_TOKEN}`,
|
|
||||||
Accept: 'application/json;api-version=6.0-preview.1'
|
|
||||||
})
|
|
||||||
|
|
||||||
const reserve = async (
|
const reserve = async (
|
||||||
key: string,
|
key: string,
|
||||||
|
@ -101,7 +96,6 @@ export function getCacheClient() {
|
||||||
[keys],
|
[keys],
|
||||||
[version]
|
[version]
|
||||||
)
|
)
|
||||||
core.info(`Cache result ${queryCacheResponse}`)
|
|
||||||
if (queryCacheResponse?.archiveLocation) {
|
if (queryCacheResponse?.archiveLocation) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
@ -111,7 +105,9 @@ export function getCacheClient() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return handleFetchError('Unable to query cache')(queryCacheResponse)
|
return {
|
||||||
|
success: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleFetchError('Unable to query cache')(error)
|
return handleFetchError('Unable to query cache')(error)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue