mirror of https://github.com/actions/toolkit
update dependencies and prettier
parent
0555a5f458
commit
4214a1ff24
|
@ -16,6 +16,7 @@
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-request-log": "^1.0.4",
|
"@octokit/plugin-request-log": "^1.0.4",
|
||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
|
"@octokit/request-error": "^5.0.0",
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"@types/unzipper": "^0.10.6",
|
"@types/unzipper": "^0.10.6",
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
|
@ -293,6 +294,32 @@
|
||||||
"universal-user-agent": "^6.0.0"
|
"universal-user-agent": "^6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@octokit/request-error": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-1ue0DH0Lif5iEqT52+Rf/hf0RmGO9NWFjrzmrkArpG9trFfDM/efx00BJHdLGuro4BR/gECxCU2Twf5OKrRFsQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^11.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"once": "^1.4.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
|
||||||
|
"version": "18.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz",
|
||||||
|
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw=="
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request-error/node_modules/@octokit/types": {
|
||||||
|
"version": "11.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz",
|
||||||
|
"integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/openapi-types": "^18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@octokit/request/node_modules/@octokit/request-error": {
|
"node_modules/@octokit/request/node_modules/@octokit/request-error": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-request-log": "^1.0.4",
|
"@octokit/plugin-request-log": "^1.0.4",
|
||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
|
"@octokit/request-error": "^5.0.0",
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"@types/unzipper": "^0.10.6",
|
"@types/unzipper": "^0.10.6",
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
|
|
|
@ -61,7 +61,9 @@ export async function downloadArtifact(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(await exists(downloadPath))) {
|
if (!(await exists(downloadPath))) {
|
||||||
core.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`)
|
core.debug(
|
||||||
|
`Artifact destination folder does not exist, creating: ${downloadPath}`
|
||||||
|
)
|
||||||
await fs.mkdir(downloadPath, {recursive: true})
|
await fs.mkdir(downloadPath, {recursive: true})
|
||||||
} else {
|
} else {
|
||||||
core.debug(`Artifact destination folder already exists: ${downloadPath}`)
|
core.debug(`Artifact destination folder already exists: ${downloadPath}`)
|
||||||
|
|
|
@ -25,7 +25,6 @@ export async function getArtifact(
|
||||||
repositoryName: string,
|
repositoryName: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<GetArtifactResponse> {
|
): Promise<GetArtifactResponse> {
|
||||||
|
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(
|
const [retryOpts, requestOpts] = getRetryOptions(
|
||||||
maxRetryNumber,
|
maxRetryNumber,
|
||||||
exemptStatusCodes,
|
exemptStatusCodes,
|
||||||
|
@ -42,22 +41,25 @@ export async function getArtifact(
|
||||||
|
|
||||||
const github = getOctokit(token, opts, retry, requestLog)
|
const github = getOctokit(token, opts, retry, requestLog)
|
||||||
|
|
||||||
const getArtifactResp = await github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}', {
|
const getArtifactResp = await github.request(
|
||||||
|
'GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}',
|
||||||
|
{
|
||||||
owner: repositoryOwner,
|
owner: repositoryOwner,
|
||||||
repo: repositoryName,
|
repo: repositoryName,
|
||||||
run_id: workflowRunId,
|
run_id: workflowRunId,
|
||||||
name: artifactName,
|
name: artifactName
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if (getArtifactResp.status !== 200) {
|
if (getArtifactResp.status !== 200) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getArtifactResp.data.artifacts.length === 0) {
|
if (getArtifactResp.data.artifacts.length === 0) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ export async function getArtifact(
|
||||||
name: getArtifactResp.data.artifacts[0].name,
|
name: getArtifactResp.data.artifacts[0].name,
|
||||||
id: getArtifactResp.data.artifacts[0].id,
|
id: getArtifactResp.data.artifacts[0].id,
|
||||||
url: getArtifactResp.data.artifacts[0].url,
|
url: getArtifactResp.data.artifacts[0].url,
|
||||||
size: getArtifactResp.data.artifacts[0].size_in_bytes,
|
size: getArtifactResp.data.artifacts[0].size_in_bytes
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,9 @@ export async function listArtifacts(
|
||||||
repositoryName: string,
|
repositoryName: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<ListArtifactsResponse> {
|
): Promise<ListArtifactsResponse> {
|
||||||
info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`)
|
info(
|
||||||
|
`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`
|
||||||
|
)
|
||||||
|
|
||||||
const artifacts: Artifact[] = []
|
const artifacts: Artifact[] = []
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(
|
const [retryOpts, requestOpts] = getRetryOptions(
|
||||||
|
|
Loading…
Reference in New Issue