Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0389dcd5e4 | |||
| 64b2775394 | |||
| 439cd9b37e | |||
| c1ded1dc4d | |||
| f37c445bc5 | |||
| e95bcfe359 | |||
| 7549d1b218 | |||
| 2124ef2413 | |||
| d617670abc | |||
| 47157e5ade | |||
| 8a6aae0a16 | |||
| 58ec2bdcc9 | |||
| e19b629130 | |||
| d63a8c4d3f | |||
| 67d2d582dc | |||
| 9d70b8a9fb | |||
| 7f47ffaee2 | |||
| 98e1a813db | |||
| 0d39975814 | |||
| f482643a6e | |||
| ff2c524611 | |||
| ecb4df89bf | |||
| 03319fcffa | |||
| c33724abbd | |||
| d6f3ee93b8 | |||
| 34a411f3c0 | |||
| 2d6ba67518 | |||
| 5430c5d848 | |||
| bc68ce94ea | |||
| 78ed49ff88 | |||
| c119fcd773 | |||
| 73babeabef | |||
| bf93b54558 | |||
| 0c0770ce57 | |||
| 571bf222ee | |||
| 68f22927e7 | |||
| 11a2dd3117 | |||
| 43c63eef65 | |||
| 6a9034d692 | |||
| eff198be5b | |||
| 16b786a545 | |||
| 18ce228b82 | |||
| a4bd0f1214 | |||
| 37a66ebd47 | |||
| 09249a72d7 | |||
| 4c531c013a | |||
| 3c3af56b29 | |||
| 950e1711a1 | |||
| 88b76de595 | |||
| 55a05255d7 | |||
| 64d1b104d0 | |||
| 43ccaf05d9 | |||
| f732e4cd62 | |||
| 8c317a0e59 | |||
| 715b1acc05 | |||
| 207747e7af |
@@ -1,5 +1,3 @@
|
|||||||
# Temporarily disabled while v2.0.0 of @actions/artifact is under development
|
|
||||||
|
|
||||||
name: artifact-unit-tests
|
name: artifact-unit-tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,8 +10,8 @@ on:
|
|||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
upload:
|
||||||
name: Build
|
name: Upload
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -42,19 +40,13 @@ jobs:
|
|||||||
npm run tsc
|
npm run tsc
|
||||||
working-directory: packages/artifact
|
working-directory: packages/artifact
|
||||||
|
|
||||||
- name: Set artifact file contents
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "file1=hello from file 1" >> $GITHUB_ENV
|
|
||||||
echo "file2=hello from file 2" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create files that will be uploaded
|
- name: Create files that will be uploaded
|
||||||
run: |
|
run: |
|
||||||
mkdir artifact-path
|
mkdir artifact-path
|
||||||
echo '${{ env.file1 }}' > artifact-path/first.txt
|
echo -n 'hello from file 1' > artifact-path/first.txt
|
||||||
echo '${{ env.file2 }}' > artifact-path/second.txt
|
echo -n 'hello from file 2' > artifact-path/second.txt
|
||||||
|
|
||||||
- name: Upload Artifacts using actions/github-script@v7
|
- name: Upload Artifacts
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -73,9 +65,16 @@ jobs:
|
|||||||
|
|
||||||
console.log(`Successfully uploaded artifact ${id}`)
|
console.log(`Successfully uploaded artifact ${id}`)
|
||||||
|
|
||||||
|
try {
|
||||||
|
await artifact.uploadArtifact(artifactName, fileContents, './')
|
||||||
|
throw new Error('should have failed second upload')
|
||||||
|
} catch (err) {
|
||||||
|
console.log('Successfully blocked second artifact upload')
|
||||||
|
}
|
||||||
verify:
|
verify:
|
||||||
|
name: Verify
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [upload]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -96,35 +95,72 @@ jobs:
|
|||||||
npm run tsc
|
npm run tsc
|
||||||
working-directory: packages/artifact
|
working-directory: packages/artifact
|
||||||
|
|
||||||
- name: List artifacts using actions/github-script@v7
|
- name: List and Download Artifacts
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const {default: artifact} = require('./packages/artifact/lib/artifact')
|
const {default: artifactClient} = require('./packages/artifact/lib/artifact')
|
||||||
|
|
||||||
const workflowRunId = process.env.GITHUB_RUN_ID
|
const {readFile} = require('fs/promises')
|
||||||
const repository = process.env.GITHUB_REPOSITORY
|
const path = require('path')
|
||||||
const repositoryOwner = repository.split('/')[0]
|
|
||||||
const repositoryName = repository.split('/')[1]
|
|
||||||
|
|
||||||
const listResult = await artifact.listArtifacts(workflowRunId, repositoryOwner, repositoryName, '${{ secrets.GITHUB_TOKEN }}')
|
const findBy = {
|
||||||
|
repositoryOwner: process.env.GITHUB_REPOSITORY.split('/')[0],
|
||||||
|
repositoryName: process.env.GITHUB_REPOSITORY.split('/')[1],
|
||||||
|
token: '${{ secrets.GITHUB_TOKEN }}',
|
||||||
|
workflowRunId: process.env.GITHUB_RUN_ID
|
||||||
|
}
|
||||||
|
|
||||||
|
const listResult = await artifactClient.listArtifacts({latest: true, findBy})
|
||||||
console.log(listResult)
|
console.log(listResult)
|
||||||
|
|
||||||
const artifacts = listResult.artifacts
|
const artifacts = listResult.artifacts
|
||||||
|
const expected = [
|
||||||
|
'my-artifact-ubuntu-latest',
|
||||||
|
'my-artifact-windows-latest',
|
||||||
|
'my-artifact-macos-latest'
|
||||||
|
]
|
||||||
|
|
||||||
if (artifacts.length !== 3) {
|
const foundArtifacts = artifacts.filter(artifact =>
|
||||||
throw new Error('Expected 3 artifacts but only found ' + artifacts.length + ' artifacts')
|
expected.includes(artifact.name)
|
||||||
}
|
)
|
||||||
|
|
||||||
const artifactNames = artifacts.map(artifact => artifact.name)
|
if (foundArtifacts.length !== 3) {
|
||||||
if (!artifactNames.includes('my-artifact-ubuntu-latest')){
|
console.log('Unexpected length of found artifacts', foundArtifacts)
|
||||||
throw new Error("Expected artifact list to contain an artifact named my-artifact-ubuntu-latest but it's missing")
|
throw new Error(
|
||||||
}
|
`Expected 3 artifacts but found ${foundArtifacts.length} artifacts.`
|
||||||
if (!artifactNames.includes('my-artifact-windows-latest')){
|
)
|
||||||
throw new Error("Expected artifact list to contain an artifact named my-artifact-windows-latest but it's missing")
|
|
||||||
}
|
|
||||||
if (!artifactNames.includes('my-artifact-macos-latest')){
|
|
||||||
throw new Error("Expected artifact list to contain an artifact named my-artifact-macos-latest but it's missing")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Successfully listed artifacts that were uploaded')
|
console.log('Successfully listed artifacts that were uploaded')
|
||||||
|
|
||||||
|
const files = [
|
||||||
|
{name: 'artifact-path/first.txt', content: 'hello from file 1'},
|
||||||
|
{name: 'artifact-path/second.txt', content: 'hello from file 2'}
|
||||||
|
]
|
||||||
|
|
||||||
|
for (const artifact of foundArtifacts) {
|
||||||
|
const {downloadPath} = await artifactClient.downloadArtifact(artifact.id, {
|
||||||
|
path: artifact.name,
|
||||||
|
findBy
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('Downloaded artifact to:', downloadPath)
|
||||||
|
|
||||||
|
for (const file of files) {
|
||||||
|
const filepath = path.join(
|
||||||
|
process.env.GITHUB_WORKSPACE,
|
||||||
|
downloadPath,
|
||||||
|
file.name
|
||||||
|
)
|
||||||
|
|
||||||
|
console.log('Checking file:', filepath)
|
||||||
|
|
||||||
|
const content = await readFile(filepath, 'utf8')
|
||||||
|
if (content.trim() !== file.content.trim()) {
|
||||||
|
throw new Error(
|
||||||
|
`Expected file '${file.name}' to contain '${file.content}' but found '${content}'`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,4 +8,4 @@ module.exports = {
|
|||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
verbose: true
|
verbose: true
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+3
-3
@@ -5781,9 +5781,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.4",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
|
||||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
"lint": "eslint packages/**/*.ts",
|
"lint": "eslint packages/**/*.ts",
|
||||||
"lint-fix": "eslint packages/**/*.ts --fix",
|
"lint-fix": "eslint packages/**/*.ts --fix",
|
||||||
"new-package": "scripts/create-package",
|
"new-package": "scripts/create-package",
|
||||||
"test": "jest --testTimeout 10000"
|
"test": "jest --testTimeout 60000"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^29.5.4",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi
|
|||||||
## v2 - What's New
|
## v2 - What's New
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> @actions/artifact v2+, upload-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2).
|
> @actions/artifact v2+, upload-artifact@v4+, and download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2).
|
||||||
|
|
||||||
The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.
|
The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.
|
||||||
|
|
||||||
@@ -63,10 +63,16 @@ Import the module:
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// ES6 module
|
// ES6 module
|
||||||
import artifact from '@actions/artifact'
|
import {DefaultArtifactClient} from '@actions/artifact'
|
||||||
|
|
||||||
// CommonJS
|
// CommonJS
|
||||||
const {default: artifact} = require('@actions/artifact')
|
const {DefaultArtifactClient} = require('@actions/artifact')
|
||||||
|
```
|
||||||
|
|
||||||
|
Then instantiate:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const artifact = new DefaultArtifactClient()
|
||||||
```
|
```
|
||||||
|
|
||||||
ℹ️ For a comprehensive list of classes, interfaces, functions and more, see the [generated documentation](./docs/generated/README.md).
|
ℹ️ For a comprehensive list of classes, interfaces, functions and more, see the [generated documentation](./docs/generated/README.md).
|
||||||
|
|||||||
@@ -97,7 +97,11 @@
|
|||||||
|
|
||||||
### 2.0.0
|
### 2.0.0
|
||||||
|
|
||||||
Major release. Supports new Artifact backend for improved speed, reliability and behavior.
|
- Major release. Supports new Artifact backend for improved speed, reliability and behavior.
|
||||||
Numerous API changes, [some breaking](./README.md#breaking-changes).
|
- Numerous API changes, [some breaking](./README.md#breaking-changes).
|
||||||
|
|
||||||
Blog post with more info: TBD
|
- Blog post with more info: TBD
|
||||||
|
|
||||||
|
### 2.0.1
|
||||||
|
|
||||||
|
- Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249
|
||||||
|
|||||||
@@ -4,9 +4,16 @@ import {HttpClient} from '@actions/http-client'
|
|||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config'
|
||||||
import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client'
|
import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common'
|
||||||
|
import {NetworkError, UsageError} from '../src/internal/shared/errors'
|
||||||
|
|
||||||
jest.mock('@actions/http-client')
|
jest.mock('@actions/http-client')
|
||||||
|
|
||||||
|
const clientOptions = {
|
||||||
|
maxAttempts: 5,
|
||||||
|
retryIntervalMs: 1,
|
||||||
|
retryMultiplier: 1.5
|
||||||
|
}
|
||||||
|
|
||||||
describe('artifact-http-client', () => {
|
describe('artifact-http-client', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
noopLogs()
|
noopLogs()
|
||||||
@@ -94,11 +101,7 @@ describe('artifact-http-client', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const client = internalArtifactTwirpClient({
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
maxAttempts: 5,
|
|
||||||
retryIntervalMs: 1,
|
|
||||||
retryMultiplier: 1.5
|
|
||||||
})
|
|
||||||
const artifact = await client.CreateArtifact({
|
const artifact = await client.CreateArtifact({
|
||||||
workflowRunBackendId: '1234',
|
workflowRunBackendId: '1234',
|
||||||
workflowJobRunBackendId: '5678',
|
workflowJobRunBackendId: '5678',
|
||||||
@@ -133,11 +136,7 @@ describe('artifact-http-client', () => {
|
|||||||
post: mockPost
|
post: mockPost
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const client = internalArtifactTwirpClient({
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
maxAttempts: 5,
|
|
||||||
retryIntervalMs: 1,
|
|
||||||
retryMultiplier: 1.5
|
|
||||||
})
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
await client.CreateArtifact({
|
await client.CreateArtifact({
|
||||||
workflowRunBackendId: '1234',
|
workflowRunBackendId: '1234',
|
||||||
@@ -172,11 +171,7 @@ describe('artifact-http-client', () => {
|
|||||||
post: mockPost
|
post: mockPost
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const client = internalArtifactTwirpClient({
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
maxAttempts: 5,
|
|
||||||
retryIntervalMs: 1,
|
|
||||||
retryMultiplier: 1.5
|
|
||||||
})
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
await client.CreateArtifact({
|
await client.CreateArtifact({
|
||||||
workflowRunBackendId: '1234',
|
workflowRunBackendId: '1234',
|
||||||
@@ -190,4 +185,116 @@ describe('artifact-http-client', () => {
|
|||||||
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
expect(mockPost).toHaveBeenCalledTimes(1)
|
expect(mockPost).toHaveBeenCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should fail with a descriptive error', async () => {
|
||||||
|
// 409 duplicate error
|
||||||
|
const mockPost = jest.fn(() => {
|
||||||
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgFailed.statusCode = 409
|
||||||
|
msgFailed.statusMessage = 'Conflict'
|
||||||
|
return {
|
||||||
|
message: msgFailed,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
`{"msg": "an artifact with this name already exists on the workflow run"}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockHttpClient = (
|
||||||
|
HttpClient as unknown as jest.Mock
|
||||||
|
).mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
post: mockPost
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
|
await expect(async () => {
|
||||||
|
await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
}).rejects.toThrowError(
|
||||||
|
'Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run'
|
||||||
|
)
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
|
expect(mockPost).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should properly describe a network failure', async () => {
|
||||||
|
class FakeNodeError extends Error {
|
||||||
|
code: string
|
||||||
|
constructor(code: string) {
|
||||||
|
super()
|
||||||
|
this.code = code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mockPost = jest.fn(() => {
|
||||||
|
throw new FakeNodeError('ENOTFOUND')
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockHttpClient = (
|
||||||
|
HttpClient as unknown as jest.Mock
|
||||||
|
).mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
post: mockPost
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const client = internalArtifactTwirpClient()
|
||||||
|
await expect(async () => {
|
||||||
|
await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
}).rejects.toThrowError(new NetworkError('ENOTFOUND').message)
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
|
expect(mockPost).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should properly describe a usage error', async () => {
|
||||||
|
const mockPost = jest.fn(() => {
|
||||||
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgFailed.statusCode = 403
|
||||||
|
msgFailed.statusMessage = 'Forbidden'
|
||||||
|
return {
|
||||||
|
message: msgFailed,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
`{"msg": "insufficient usage to create artifact"}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockHttpClient = (
|
||||||
|
HttpClient as unknown as jest.Mock
|
||||||
|
).mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
post: mockPost
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const client = internalArtifactTwirpClient()
|
||||||
|
await expect(async () => {
|
||||||
|
await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
}).rejects.toThrowError(new UsageError().message)
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
|
expect(mockPost).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import archiver from 'archiver'
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
downloadArtifactInternal,
|
downloadArtifactInternal,
|
||||||
downloadArtifactPublic
|
downloadArtifactPublic,
|
||||||
|
streamExtractExternal
|
||||||
} from '../src/internal/download/download-artifact'
|
} from '../src/internal/download/download-artifact'
|
||||||
import {getUserAgentString} from '../src/internal/shared/user-agent'
|
import {getUserAgentString} from '../src/internal/shared/user-agent'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common'
|
||||||
@@ -104,6 +105,7 @@ const mockGetArtifactSuccess = jest.fn(() => {
|
|||||||
const message = new http.IncomingMessage(new net.Socket())
|
const message = new http.IncomingMessage(new net.Socket())
|
||||||
message.statusCode = 200
|
message.statusCode = 200
|
||||||
message.push(fs.readFileSync(fixtures.exampleArtifact.path))
|
message.push(fs.readFileSync(fixtures.exampleArtifact.path))
|
||||||
|
message.push(null)
|
||||||
return {
|
return {
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
@@ -113,6 +115,7 @@ const mockGetArtifactFailure = jest.fn(() => {
|
|||||||
const message = new http.IncomingMessage(new net.Socket())
|
const message = new http.IncomingMessage(new net.Socket())
|
||||||
message.statusCode = 500
|
message.statusCode = 500
|
||||||
message.push('Internal Server Error')
|
message.push('Internal Server Error')
|
||||||
|
message.push(null)
|
||||||
return {
|
return {
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
@@ -246,7 +249,44 @@ describe('download-artifact', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should fail if blob storage response is non-200', async () => {
|
it('should fail if blob storage storage chunk does not respond within 30s', async () => {
|
||||||
|
// mock http client to delay response data by 30s
|
||||||
|
const msg = new http.IncomingMessage(new net.Socket())
|
||||||
|
msg.statusCode = 200
|
||||||
|
|
||||||
|
const mockGet = jest.fn(async () => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// Resolve with a 200 status code immediately
|
||||||
|
resolve({
|
||||||
|
message: msg,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve(`{"ok": true}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Reject with an error after 31 seconds
|
||||||
|
setTimeout(() => {
|
||||||
|
reject(new Error('Request timeout'))
|
||||||
|
}, 31000) // Timeout after 31 seconds
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockHttpClient = (HttpClient as jest.Mock).mockImplementation(
|
||||||
|
() => {
|
||||||
|
return {
|
||||||
|
get: mockGet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
streamExtractExternal(fixtures.blobStorageUrl, fixtures.workspaceDir)
|
||||||
|
).rejects.toBeInstanceOf(Error)
|
||||||
|
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString())
|
||||||
|
}, 35000) // add longer timeout to allow for timer to run out
|
||||||
|
|
||||||
|
it('should fail if blob storage response is non-200 after 5 retries', async () => {
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
||||||
.actions.downloadArtifact as MockedDownloadArtifact
|
.actions.downloadArtifact as MockedDownloadArtifact
|
||||||
downloadArtifactMock.mockResolvedValueOnce({
|
downloadArtifactMock.mockResolvedValueOnce({
|
||||||
@@ -288,7 +328,60 @@ describe('download-artifact', () => {
|
|||||||
expect(mockGetArtifactFailure).toHaveBeenCalledWith(
|
expect(mockGetArtifactFailure).toHaveBeenCalledWith(
|
||||||
fixtures.blobStorageUrl
|
fixtures.blobStorageUrl
|
||||||
)
|
)
|
||||||
})
|
expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5)
|
||||||
|
}, 38000)
|
||||||
|
|
||||||
|
it('should retry if blob storage response is non-200 and then succeed with a 200', async () => {
|
||||||
|
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
||||||
|
.actions.downloadArtifact as MockedDownloadArtifact
|
||||||
|
downloadArtifactMock.mockResolvedValueOnce({
|
||||||
|
headers: {
|
||||||
|
location: fixtures.blobStorageUrl
|
||||||
|
},
|
||||||
|
status: 302,
|
||||||
|
url: '',
|
||||||
|
data: Buffer.from('')
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockGetArtifact = jest
|
||||||
|
.fn(mockGetArtifactSuccess)
|
||||||
|
.mockImplementationOnce(mockGetArtifactFailure)
|
||||||
|
|
||||||
|
const mockHttpClient = (HttpClient as jest.Mock).mockImplementation(
|
||||||
|
() => {
|
||||||
|
return {
|
||||||
|
get: mockGetArtifact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const response = await downloadArtifactPublic(
|
||||||
|
fixtures.artifactID,
|
||||||
|
fixtures.repositoryOwner,
|
||||||
|
fixtures.repositoryName,
|
||||||
|
fixtures.token
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
||||||
|
owner: fixtures.repositoryOwner,
|
||||||
|
repo: fixtures.repositoryName,
|
||||||
|
artifact_id: fixtures.artifactID,
|
||||||
|
archive_format: 'zip',
|
||||||
|
request: {
|
||||||
|
redirect: 'manual'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString())
|
||||||
|
expect(mockGetArtifactFailure).toHaveBeenCalledWith(
|
||||||
|
fixtures.blobStorageUrl
|
||||||
|
)
|
||||||
|
expect(mockGetArtifactFailure).toHaveBeenCalledTimes(1)
|
||||||
|
expect(mockGetArtifactSuccess).toHaveBeenCalledWith(
|
||||||
|
fixtures.blobStorageUrl
|
||||||
|
)
|
||||||
|
expect(mockGetArtifactSuccess).toHaveBeenCalledTimes(1)
|
||||||
|
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
||||||
|
}, 28000)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('internal', () => {
|
describe('internal', () => {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
@actions/artifact
|
||||||
|
|
||||||
|
# @actions/artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Classes
|
||||||
|
|
||||||
|
- [ArtifactNotFoundError](classes/ArtifactNotFoundError.md)
|
||||||
|
- [DefaultArtifactClient](classes/DefaultArtifactClient.md)
|
||||||
|
- [FilesNotFoundError](classes/FilesNotFoundError.md)
|
||||||
|
- [GHESNotSupportedError](classes/GHESNotSupportedError.md)
|
||||||
|
- [InvalidResponseError](classes/InvalidResponseError.md)
|
||||||
|
|
||||||
|
### Interfaces
|
||||||
|
|
||||||
|
- [Artifact](interfaces/Artifact.md)
|
||||||
|
- [ArtifactClient](interfaces/ArtifactClient.md)
|
||||||
|
- [DownloadArtifactOptions](interfaces/DownloadArtifactOptions.md)
|
||||||
|
- [DownloadArtifactResponse](interfaces/DownloadArtifactResponse.md)
|
||||||
|
- [FindOptions](interfaces/FindOptions.md)
|
||||||
|
- [GetArtifactResponse](interfaces/GetArtifactResponse.md)
|
||||||
|
- [ListArtifactsOptions](interfaces/ListArtifactsOptions.md)
|
||||||
|
- [ListArtifactsResponse](interfaces/ListArtifactsResponse.md)
|
||||||
|
- [UploadArtifactOptions](interfaces/UploadArtifactOptions.md)
|
||||||
|
- [UploadArtifactResponse](interfaces/UploadArtifactResponse.md)
|
||||||
|
|
||||||
|
### Variables
|
||||||
|
|
||||||
|
- [default](README.md#default)
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
### default
|
||||||
|
|
||||||
|
• `Const` **default**: [`ArtifactClient`](interfaces/ArtifactClient.md)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/artifact.ts:7](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/artifact.ts#L7)
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
[@actions/artifact](../README.md) / ArtifactNotFoundError
|
||||||
|
|
||||||
|
# Class: ArtifactNotFoundError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`ArtifactNotFoundError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](ArtifactNotFoundError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [message](ArtifactNotFoundError.md#message)
|
||||||
|
- [name](ArtifactNotFoundError.md#name)
|
||||||
|
- [stack](ArtifactNotFoundError.md#stack)
|
||||||
|
- [prepareStackTrace](ArtifactNotFoundError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](ArtifactNotFoundError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](ArtifactNotFoundError.md#capturestacktrace)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new ArtifactNotFoundError**(`message?`): [`ArtifactNotFoundError`](ArtifactNotFoundError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Default value |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `message` | `string` | `'Artifact not found'` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`ArtifactNotFoundError`](ArtifactNotFoundError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L24)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
[@actions/artifact](../README.md) / DefaultArtifactClient
|
||||||
|
|
||||||
|
# Class: DefaultArtifactClient
|
||||||
|
|
||||||
|
The default artifact client that is used by the artifact action(s).
|
||||||
|
|
||||||
|
## Implements
|
||||||
|
|
||||||
|
- [`ArtifactClient`](../interfaces/ArtifactClient.md)
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](DefaultArtifactClient.md#constructor)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [downloadArtifact](DefaultArtifactClient.md#downloadartifact)
|
||||||
|
- [getArtifact](DefaultArtifactClient.md#getartifact)
|
||||||
|
- [listArtifacts](DefaultArtifactClient.md#listartifacts)
|
||||||
|
- [uploadArtifact](DefaultArtifactClient.md#uploadartifact)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new DefaultArtifactClient**(): [`DefaultArtifactClient`](DefaultArtifactClient.md)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`DefaultArtifactClient`](DefaultArtifactClient.md)
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### downloadArtifact
|
||||||
|
|
||||||
|
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Downloads an artifact and unzips the content.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactId` | `number` | The name of the artifact to download |
|
||||||
|
| `options?` | [`DownloadArtifactOptions`](../interfaces/DownloadArtifactOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single DownloadArtifactResponse object
|
||||||
|
|
||||||
|
#### Implementation of
|
||||||
|
|
||||||
|
[ArtifactClient](../interfaces/ArtifactClient.md).[downloadArtifact](../interfaces/ArtifactClient.md#downloadartifact)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:119](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L119)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### getArtifact
|
||||||
|
|
||||||
|
▸ **getArtifact**(`artifactName`, `options?`): `Promise`\<[`GetArtifactResponse`](../interfaces/GetArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Finds an artifact by name.
|
||||||
|
If there are multiple artifacts with the same name in the same workflow run, this will return the latest.
|
||||||
|
If the artifact is not found, it will throw.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs.
|
||||||
|
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
|
||||||
|
`@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run.
|
||||||
|
It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun.
|
||||||
|
If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactName` | `string` | The name of the artifact to find |
|
||||||
|
| `options?` | [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the get behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`GetArtifactResponse`](../interfaces/GetArtifactResponse.md)\>
|
||||||
|
|
||||||
|
#### Implementation of
|
||||||
|
|
||||||
|
[ArtifactClient](../interfaces/ArtifactClient.md).[getArtifact](../interfaces/ArtifactClient.md#getartifact)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:193](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L193)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### listArtifacts
|
||||||
|
|
||||||
|
▸ **listArtifacts**(`options?`): `Promise`\<[`ListArtifactsResponse`](../interfaces/ListArtifactsResponse.md)\>
|
||||||
|
|
||||||
|
Lists all artifacts that are part of the current workflow run.
|
||||||
|
This function will return at most 1000 artifacts per workflow run.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs.
|
||||||
|
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `options?` | [`ListArtifactsOptions`](../interfaces/ListArtifactsOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the list behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`ListArtifactsResponse`](../interfaces/ListArtifactsResponse.md)\>
|
||||||
|
|
||||||
|
ListArtifactResponse object
|
||||||
|
|
||||||
|
#### Implementation of
|
||||||
|
|
||||||
|
[ArtifactClient](../interfaces/ArtifactClient.md).[listArtifacts](../interfaces/ArtifactClient.md#listartifacts)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:157](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L157)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### uploadArtifact
|
||||||
|
|
||||||
|
▸ **uploadArtifact**(`name`, `files`, `rootDirectory`, `options?`): `Promise`\<[`UploadArtifactResponse`](../interfaces/UploadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Uploads an artifact.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `name` | `string` | The name of the artifact, required |
|
||||||
|
| `files` | `string`[] | A list of absolute or relative paths that denote what files should be uploaded |
|
||||||
|
| `rootDirectory` | `string` | An absolute or relative file path that denotes the root parent directory of the files being uploaded |
|
||||||
|
| `options?` | [`UploadArtifactOptions`](../interfaces/UploadArtifactOptions.md) | Extra options for customizing the upload behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`UploadArtifactResponse`](../interfaces/UploadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single UploadArtifactResponse object
|
||||||
|
|
||||||
|
#### Implementation of
|
||||||
|
|
||||||
|
[ArtifactClient](../interfaces/ArtifactClient.md).[uploadArtifact](../interfaces/ArtifactClient.md#uploadartifact)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:94](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L94)
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
[@actions/artifact](../README.md) / FilesNotFoundError
|
||||||
|
|
||||||
|
# Class: FilesNotFoundError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`FilesNotFoundError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](FilesNotFoundError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [files](FilesNotFoundError.md#files)
|
||||||
|
- [message](FilesNotFoundError.md#message)
|
||||||
|
- [name](FilesNotFoundError.md#name)
|
||||||
|
- [stack](FilesNotFoundError.md#stack)
|
||||||
|
- [prepareStackTrace](FilesNotFoundError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](FilesNotFoundError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](FilesNotFoundError.md#capturestacktrace)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new FilesNotFoundError**(`files?`): [`FilesNotFoundError`](FilesNotFoundError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Default value |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `files` | `string`[] | `[]` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`FilesNotFoundError`](FilesNotFoundError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L4)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### files
|
||||||
|
|
||||||
|
• **files**: `string`[]
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L2)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
[@actions/artifact](../README.md) / GHESNotSupportedError
|
||||||
|
|
||||||
|
# Class: GHESNotSupportedError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`GHESNotSupportedError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](GHESNotSupportedError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [message](GHESNotSupportedError.md#message)
|
||||||
|
- [name](GHESNotSupportedError.md#name)
|
||||||
|
- [stack](GHESNotSupportedError.md#stack)
|
||||||
|
- [prepareStackTrace](GHESNotSupportedError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](GHESNotSupportedError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](GHESNotSupportedError.md#capturestacktrace)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new GHESNotSupportedError**(`message?`): [`GHESNotSupportedError`](GHESNotSupportedError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Default value |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `message` | `string` | `'@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.'` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`GHESNotSupportedError`](GHESNotSupportedError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L31)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
[@actions/artifact](../README.md) / InvalidResponseError
|
||||||
|
|
||||||
|
# Class: InvalidResponseError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`InvalidResponseError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](InvalidResponseError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [message](InvalidResponseError.md#message)
|
||||||
|
- [name](InvalidResponseError.md#name)
|
||||||
|
- [stack](InvalidResponseError.md#stack)
|
||||||
|
- [prepareStackTrace](InvalidResponseError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](InvalidResponseError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](InvalidResponseError.md#capturestacktrace)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new InvalidResponseError**(`message`): [`InvalidResponseError`](InvalidResponseError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `message` | `string` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`InvalidResponseError`](InvalidResponseError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L17)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
[@actions/artifact](../README.md) / Artifact
|
||||||
|
|
||||||
|
# Interface: Artifact
|
||||||
|
|
||||||
|
An Actions Artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [createdAt](Artifact.md#createdat)
|
||||||
|
- [id](Artifact.md#id)
|
||||||
|
- [name](Artifact.md#name)
|
||||||
|
- [size](Artifact.md#size)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### createdAt
|
||||||
|
|
||||||
|
• `Optional` **createdAt**: `Date`
|
||||||
|
|
||||||
|
The time when the artifact was created
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L123)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### id
|
||||||
|
|
||||||
|
• **id**: `number`
|
||||||
|
|
||||||
|
The ID of the artifact
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L113)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
The name of the artifact
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:108](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L108)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### size
|
||||||
|
|
||||||
|
• **size**: `number`
|
||||||
|
|
||||||
|
The size of the artifact in bytes
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L118)
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
[@actions/artifact](../README.md) / ArtifactClient
|
||||||
|
|
||||||
|
# Interface: ArtifactClient
|
||||||
|
|
||||||
|
Generic interface for the artifact client.
|
||||||
|
|
||||||
|
## Implemented by
|
||||||
|
|
||||||
|
- [`DefaultArtifactClient`](../classes/DefaultArtifactClient.md)
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [downloadArtifact](ArtifactClient.md#downloadartifact)
|
||||||
|
- [getArtifact](ArtifactClient.md#getartifact)
|
||||||
|
- [listArtifacts](ArtifactClient.md#listartifacts)
|
||||||
|
- [uploadArtifact](ArtifactClient.md#uploadartifact)
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### downloadArtifact
|
||||||
|
|
||||||
|
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Downloads an artifact and unzips the content.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactId` | `number` | The name of the artifact to download |
|
||||||
|
| `options?` | [`DownloadArtifactOptions`](DownloadArtifactOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single DownloadArtifactResponse object
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:84](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L84)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### getArtifact
|
||||||
|
|
||||||
|
▸ **getArtifact**(`artifactName`, `options?`): `Promise`\<[`GetArtifactResponse`](GetArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Finds an artifact by name.
|
||||||
|
If there are multiple artifacts with the same name in the same workflow run, this will return the latest.
|
||||||
|
If the artifact is not found, it will throw.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs.
|
||||||
|
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
|
||||||
|
`@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run.
|
||||||
|
It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun.
|
||||||
|
If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactName` | `string` | The name of the artifact to find |
|
||||||
|
| `options?` | [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the get behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`GetArtifactResponse`](GetArtifactResponse.md)\>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:70](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L70)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### listArtifacts
|
||||||
|
|
||||||
|
▸ **listArtifacts**(`options?`): `Promise`\<[`ListArtifactsResponse`](ListArtifactsResponse.md)\>
|
||||||
|
|
||||||
|
Lists all artifacts that are part of the current workflow run.
|
||||||
|
This function will return at most 1000 artifacts per workflow run.
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs.
|
||||||
|
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `options?` | [`ListArtifactsOptions`](ListArtifactsOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the list behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`ListArtifactsResponse`](ListArtifactsResponse.md)\>
|
||||||
|
|
||||||
|
ListArtifactResponse object
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:52](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L52)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### uploadArtifact
|
||||||
|
|
||||||
|
▸ **uploadArtifact**(`name`, `files`, `rootDirectory`, `options?`): `Promise`\<[`UploadArtifactResponse`](UploadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Uploads an artifact.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `name` | `string` | The name of the artifact, required |
|
||||||
|
| `files` | `string`[] | A list of absolute or relative paths that denote what files should be uploaded |
|
||||||
|
| `rootDirectory` | `string` | An absolute or relative file path that denotes the root parent directory of the files being uploaded |
|
||||||
|
| `options?` | [`UploadArtifactOptions`](UploadArtifactOptions.md) | Extra options for customizing the upload behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`UploadArtifactResponse`](UploadArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single UploadArtifactResponse object
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:35](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L35)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[@actions/artifact](../README.md) / DownloadArtifactOptions
|
||||||
|
|
||||||
|
# Interface: DownloadArtifactOptions
|
||||||
|
|
||||||
|
Options for downloading an artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [path](DownloadArtifactOptions.md#path)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### path
|
||||||
|
|
||||||
|
• `Optional` **path**: `string`
|
||||||
|
|
||||||
|
Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:98](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L98)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[@actions/artifact](../README.md) / DownloadArtifactResponse
|
||||||
|
|
||||||
|
# Interface: DownloadArtifactResponse
|
||||||
|
|
||||||
|
Response from the server when downloading an artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [downloadPath](DownloadArtifactResponse.md#downloadpath)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### downloadPath
|
||||||
|
|
||||||
|
• `Optional` **downloadPath**: `string`
|
||||||
|
|
||||||
|
The path where the artifact was downloaded to
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:88](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L88)
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
[@actions/artifact](../README.md) / FindOptions
|
||||||
|
|
||||||
|
# Interface: FindOptions
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [findBy](FindOptions.md#findby)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### findBy
|
||||||
|
|
||||||
|
• `Optional` **findBy**: `Object`
|
||||||
|
|
||||||
|
The criteria for finding Artifact(s) out of the scope of the current run.
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `repositoryName` | `string` | Repository owner (eg. 'toolkit') |
|
||||||
|
| `repositoryOwner` | `string` | Repository owner (eg. 'actions') |
|
||||||
|
| `token` | `string` | Token with actions:read permissions |
|
||||||
|
| `workflowRunId` | `number` | WorkflowRun of the artifact(s) to lookup |
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:131](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L131)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[@actions/artifact](../README.md) / GetArtifactResponse
|
||||||
|
|
||||||
|
# Interface: GetArtifactResponse
|
||||||
|
|
||||||
|
Response from the server when getting an artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [artifact](GetArtifactResponse.md#artifact)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### artifact
|
||||||
|
|
||||||
|
• **artifact**: [`Artifact`](Artifact.md)
|
||||||
|
|
||||||
|
Metadata about the artifact that was found
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:57](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L57)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
[@actions/artifact](../README.md) / ListArtifactsOptions
|
||||||
|
|
||||||
|
# Interface: ListArtifactsOptions
|
||||||
|
|
||||||
|
Options for listing artifacts
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [latest](ListArtifactsOptions.md#latest)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### latest
|
||||||
|
|
||||||
|
• `Optional` **latest**: `boolean`
|
||||||
|
|
||||||
|
Filter the workflow run's artifacts to the latest by name
|
||||||
|
In the case of reruns, this can be useful to avoid duplicates
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:68](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L68)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[@actions/artifact](../README.md) / ListArtifactsResponse
|
||||||
|
|
||||||
|
# Interface: ListArtifactsResponse
|
||||||
|
|
||||||
|
Response from the server when listing artifacts
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [artifacts](ListArtifactsResponse.md#artifacts)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### artifacts
|
||||||
|
|
||||||
|
• **artifacts**: [`Artifact`](Artifact.md)[]
|
||||||
|
|
||||||
|
A list of artifacts that were found
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:78](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L78)
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
[@actions/artifact](../README.md) / UploadArtifactOptions
|
||||||
|
|
||||||
|
# Interface: UploadArtifactOptions
|
||||||
|
|
||||||
|
Options for uploading an artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [compressionLevel](UploadArtifactOptions.md#compressionlevel)
|
||||||
|
- [retentionDays](UploadArtifactOptions.md#retentiondays)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### compressionLevel
|
||||||
|
|
||||||
|
• `Optional` **compressionLevel**: `number`
|
||||||
|
|
||||||
|
The level of compression for Zlib to be applied to the artifact archive.
|
||||||
|
The value can range from 0 to 9:
|
||||||
|
- 0: No compression
|
||||||
|
- 1: Best speed
|
||||||
|
- 6: Default compression (same as GNU Gzip)
|
||||||
|
- 9: Best compression
|
||||||
|
Higher levels will result in better compression, but will take longer to complete.
|
||||||
|
For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:47](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L47)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### retentionDays
|
||||||
|
|
||||||
|
• `Optional` **retentionDays**: `number`
|
||||||
|
|
||||||
|
Duration after which artifact will expire in days.
|
||||||
|
|
||||||
|
By default artifact expires after 90 days:
|
||||||
|
https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#downloading-and-deleting-artifacts-after-a-workflow-run-is-complete
|
||||||
|
|
||||||
|
Use this option to override the default expiry.
|
||||||
|
|
||||||
|
Min value: 1
|
||||||
|
Max value: 90 unless changed by repository setting
|
||||||
|
|
||||||
|
If this is set to a greater value than the retention settings allowed, the retention on artifacts
|
||||||
|
will be reduced to match the max value allowed on server, and the upload process will continue. An
|
||||||
|
input of 0 assumes default retention setting.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:36](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L36)
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
[@actions/artifact](../README.md) / UploadArtifactResponse
|
||||||
|
|
||||||
|
# Interface: UploadArtifactResponse
|
||||||
|
|
||||||
|
Response from the server when an artifact is uploaded
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [id](UploadArtifactResponse.md#id)
|
||||||
|
- [size](UploadArtifactResponse.md#size)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### id
|
||||||
|
|
||||||
|
• `Optional` **id**: `number`
|
||||||
|
|
||||||
|
The id of the artifact that was created. Not provided if no artifact was uploaded
|
||||||
|
This ID can be used as input to other APIs to download, delete or get more information about an artifact: https://docs.github.com/en/rest/actions/artifacts
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L14)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### size
|
||||||
|
|
||||||
|
• `Optional` **size**: `number`
|
||||||
|
|
||||||
|
Total size of the artifact in bytes. Not provided if no artifact was uploaded
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L8)
|
||||||
Generated
+182
-139
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
@@ -18,15 +18,17 @@
|
|||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
"@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",
|
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0",
|
||||||
"unzipper": "^0.10.14"
|
"unzip-stream": "^0.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
|
"@types/unzip-stream": "^0.3.4",
|
||||||
|
"typedoc": "^0.25.4",
|
||||||
|
"typedoc-plugin-markdown": "^3.17.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -469,14 +471,21 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/unzipper": {
|
"node_modules/@types/unzip-stream": {
|
||||||
"version": "0.10.6",
|
"version": "0.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/unzip-stream/-/unzip-stream-0.3.4.tgz",
|
||||||
"integrity": "sha512-zcBj329AHgKLQyz209N/S9R0GZqXSkUQO4tJSYE3x02qg4JuDFpgKMj50r82Erk1natCWQDIvSccDddt7jPzjA==",
|
"integrity": "sha512-ud0vtsNRF+joUCyvNMyo0j5DKX2Lh/im+xVgRzBEsfHhQYZ+i4fKTveova9XxLzt6Jl6G0e/0mM4aC0gqZYSnA==",
|
||||||
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ansi-sequence-parser": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/archiver": {
|
"node_modules/archiver": {
|
||||||
"version": "5.3.1",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz",
|
||||||
@@ -580,14 +589,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
||||||
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
||||||
},
|
},
|
||||||
"node_modules/big-integer": {
|
|
||||||
"version": "1.6.51",
|
|
||||||
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
|
|
||||||
"integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/binary": {
|
"node_modules/binary": {
|
||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
|
||||||
@@ -610,11 +611,6 @@
|
|||||||
"readable-stream": "^3.4.0"
|
"readable-stream": "^3.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bluebird": {
|
|
||||||
"version": "3.4.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
|
|
||||||
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
|
|
||||||
},
|
|
||||||
"node_modules/bottleneck": {
|
"node_modules/bottleneck": {
|
||||||
"version": "2.19.5",
|
"version": "2.19.5",
|
||||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||||
@@ -660,14 +656,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer-indexof-polyfill": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/buffers": {
|
"node_modules/buffers": {
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
|
||||||
@@ -793,41 +781,6 @@
|
|||||||
"dot-object": "bin/dot-object"
|
"dot-object": "bin/dot-object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/duplexer2": {
|
|
||||||
"version": "0.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
|
|
||||||
"integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",
|
|
||||||
"dependencies": {
|
|
||||||
"readable-stream": "^2.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/duplexer2/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/end-of-stream": {
|
"node_modules/end-of-stream": {
|
||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
||||||
@@ -867,20 +820,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||||
},
|
},
|
||||||
"node_modules/fstream": {
|
|
||||||
"version": "1.0.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
|
|
||||||
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
|
|
||||||
"dependencies": {
|
|
||||||
"graceful-fs": "^4.1.2",
|
|
||||||
"inherits": "~2.0.0",
|
|
||||||
"mkdirp": ">=0.5 0",
|
|
||||||
"rimraf": "2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
@@ -905,6 +844,27 @@
|
|||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/handlebars": {
|
||||||
|
"version": "4.7.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||||
|
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"minimist": "^1.2.5",
|
||||||
|
"neo-async": "^2.6.2",
|
||||||
|
"source-map": "^0.6.1",
|
||||||
|
"wordwrap": "^1.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"handlebars": "bin/handlebars"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.7"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"uglify-js": "^3.1.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ieee754": {
|
"node_modules/ieee754": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||||
@@ -951,6 +911,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/jsonc-parser": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/jwt-decode": {
|
"node_modules/jwt-decode": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
|
||||||
@@ -994,11 +960,6 @@
|
|||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/listenercount": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
@@ -1037,6 +998,24 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/lunr": {
|
||||||
|
"version": "2.3.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
|
||||||
|
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/marked": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"marked": "bin/marked.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mime-db": {
|
"node_modules/mime-db": {
|
||||||
"version": "1.52.0",
|
"version": "1.52.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
@@ -1086,6 +1065,12 @@
|
|||||||
"mkdirp": "bin/cmd.js"
|
"mkdirp": "bin/cmd.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/neo-async": {
|
||||||
|
"version": "2.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||||
|
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/no-case": {
|
"node_modules/no-case": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
|
||||||
@@ -1219,17 +1204,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rimraf": {
|
|
||||||
"version": "2.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
|
||||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
|
||||||
"dependencies": {
|
|
||||||
"glob": "^7.1.3"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"rimraf": "bin.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/safe-buffer": {
|
"node_modules/safe-buffer": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
@@ -1254,10 +1228,26 @@
|
|||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
"node_modules/setimmediate": {
|
"node_modules/shiki": {
|
||||||
"version": "1.0.5",
|
"version": "0.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz",
|
||||||
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
|
"integrity": "sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-sequence-parser": "^1.1.0",
|
||||||
|
"jsonc-parser": "^3.2.0",
|
||||||
|
"vscode-oniguruma": "^1.7.0",
|
||||||
|
"vscode-textmate": "^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/source-map": {
|
||||||
|
"version": "0.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string_decoder": {
|
"node_modules/string_decoder": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
@@ -1345,6 +1335,63 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/typedoc": {
|
||||||
|
"version": "0.25.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz",
|
||||||
|
"integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"lunr": "^2.3.9",
|
||||||
|
"marked": "^4.3.0",
|
||||||
|
"minimatch": "^9.0.3",
|
||||||
|
"shiki": "^0.14.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"typedoc": "bin/typedoc"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 16"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/typedoc-plugin-markdown": {
|
||||||
|
"version": "3.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz",
|
||||||
|
"integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"handlebars": "^4.7.7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typedoc": ">=0.24.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/typedoc/node_modules/brace-expansion": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/typedoc/node_modules/minimatch": {
|
||||||
|
"version": "9.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
||||||
|
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.2.2",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
|
||||||
@@ -1358,53 +1405,31 @@
|
|||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/uglify-js": {
|
||||||
|
"version": "3.17.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
|
||||||
|
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"bin": {
|
||||||
|
"uglifyjs": "bin/uglifyjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/universal-user-agent": {
|
"node_modules/universal-user-agent": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||||
},
|
},
|
||||||
"node_modules/unzipper": {
|
"node_modules/unzip-stream": {
|
||||||
"version": "0.10.14",
|
"version": "0.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz",
|
"resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz",
|
||||||
"integrity": "sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==",
|
"integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"big-integer": "^1.6.17",
|
"binary": "^0.3.0",
|
||||||
"binary": "~0.3.0",
|
"mkdirp": "^0.5.1"
|
||||||
"bluebird": "~3.4.1",
|
|
||||||
"buffer-indexof-polyfill": "~1.0.0",
|
|
||||||
"duplexer2": "~0.1.4",
|
|
||||||
"fstream": "^1.0.12",
|
|
||||||
"graceful-fs": "^4.2.2",
|
|
||||||
"listenercount": "~1.0.1",
|
|
||||||
"readable-stream": "~2.3.6",
|
|
||||||
"setimmediate": "~1.0.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/unzipper/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
@@ -1420,6 +1445,18 @@
|
|||||||
"uuid": "dist/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vscode-oniguruma": {
|
||||||
|
"version": "1.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
|
||||||
|
"integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/vscode-textmate": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
@@ -1434,6 +1471,12 @@
|
|||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/wordwrap": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions artifact lib",
|
"description": "Actions artifact lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -33,7 +33,8 @@
|
|||||||
"test": "cd ../../ && npm run test ./packages/artifact",
|
"test": "cd ../../ && npm run test ./packages/artifact",
|
||||||
"bootstrap": "cd ../../ && npm run bootstrap",
|
"bootstrap": "cd ../../ && npm run bootstrap",
|
||||||
"tsc-run": "tsc",
|
"tsc-run": "tsc",
|
||||||
"tsc": "npm run bootstrap && npm run tsc-run"
|
"tsc": "npm run bootstrap && npm run tsc-run",
|
||||||
|
"gen:docs": "typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
@@ -48,15 +49,17 @@
|
|||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
"@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",
|
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0",
|
||||||
"unzipper": "^0.10.14"
|
"unzip-stream": "^0.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^5.3.2",
|
||||||
|
"@types/unzip-stream": "^0.3.4",
|
||||||
|
"typedoc": "^0.25.4",
|
||||||
|
"typedoc-plugin-markdown": "^3.17.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ import fs from 'fs/promises'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as httpClient from '@actions/http-client'
|
import * as httpClient from '@actions/http-client'
|
||||||
import unzipper from 'unzipper'
|
import unzip from 'unzip-stream'
|
||||||
import {
|
import {
|
||||||
DownloadArtifactOptions,
|
DownloadArtifactOptions,
|
||||||
DownloadArtifactResponse
|
DownloadArtifactResponse
|
||||||
@@ -38,16 +38,66 @@ async function exists(path: string): Promise<boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function streamExtract(url: string, directory: string): Promise<void> {
|
async function streamExtract(url: string, directory: string): Promise<void> {
|
||||||
|
let retryCount = 0
|
||||||
|
while (retryCount < 5) {
|
||||||
|
try {
|
||||||
|
await streamExtractExternal(url, directory)
|
||||||
|
return
|
||||||
|
} catch (error) {
|
||||||
|
retryCount++
|
||||||
|
core.debug(
|
||||||
|
`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`
|
||||||
|
)
|
||||||
|
// wait 5 seconds before retrying
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 5000))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(`Artifact download failed after ${retryCount} retries.`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function streamExtractExternal(
|
||||||
|
url: string,
|
||||||
|
directory: string
|
||||||
|
): Promise<void> {
|
||||||
const client = new httpClient.HttpClient(getUserAgentString())
|
const client = new httpClient.HttpClient(getUserAgentString())
|
||||||
const response = await client.get(url)
|
const response = await client.get(url)
|
||||||
|
|
||||||
if (response.message.statusCode !== 200) {
|
if (response.message.statusCode !== 200) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`
|
`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.message.pipe(unzipper.Extract({path: directory})).promise()
|
const timeout = 30 * 1000 // 30 seconds
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const timerFn = (): void => {
|
||||||
|
response.message.destroy(
|
||||||
|
new Error(`Blob storage chunk did not respond in ${timeout}ms`)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const timer = setTimeout(timerFn, timeout)
|
||||||
|
|
||||||
|
response.message
|
||||||
|
.on('data', () => {
|
||||||
|
timer.refresh()
|
||||||
|
})
|
||||||
|
.on('error', (error: Error) => {
|
||||||
|
core.debug(
|
||||||
|
`response.message: Artifact download failed: ${error.message}`
|
||||||
|
)
|
||||||
|
clearTimeout(timer)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
.pipe(unzip.Extract({path: directory}))
|
||||||
|
.on('close', () => {
|
||||||
|
clearTimeout(timer)
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
.on('error', (error: Error) => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadArtifactPublic(
|
export async function downloadArtifactPublic(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {info, debug} from '@actions/core'
|
|||||||
import {ArtifactServiceClientJSON} from '../../generated'
|
import {ArtifactServiceClientJSON} from '../../generated'
|
||||||
import {getResultsServiceUrl, getRuntimeToken} from './config'
|
import {getResultsServiceUrl, getRuntimeToken} from './config'
|
||||||
import {getUserAgentString} from './user-agent'
|
import {getUserAgentString} from './user-agent'
|
||||||
|
import {NetworkError, UsageError} from './errors'
|
||||||
|
|
||||||
// The twirp http client must implement this interface
|
// The twirp http client must implement this interface
|
||||||
interface Rpc {
|
interface Rpc {
|
||||||
@@ -59,11 +60,11 @@ class ArtifactHttpClient implements Rpc {
|
|||||||
'Content-Type': contentType
|
'Content-Type': contentType
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const response = await this.retryableRequest(async () =>
|
const {body} = await this.retryableRequest(async () =>
|
||||||
this.httpClient.post(url, JSON.stringify(data), headers)
|
this.httpClient.post(url, JSON.stringify(data), headers)
|
||||||
)
|
)
|
||||||
const body = await response.readBody()
|
|
||||||
return JSON.parse(body)
|
return body
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`Failed to ${method}: ${error.message}`)
|
throw new Error(`Failed to ${method}: ${error.message}`)
|
||||||
}
|
}
|
||||||
@@ -71,25 +72,47 @@ class ArtifactHttpClient implements Rpc {
|
|||||||
|
|
||||||
async retryableRequest(
|
async retryableRequest(
|
||||||
operation: () => Promise<HttpClientResponse>
|
operation: () => Promise<HttpClientResponse>
|
||||||
): Promise<HttpClientResponse> {
|
): Promise<{response: HttpClientResponse; body: object}> {
|
||||||
let attempt = 0
|
let attempt = 0
|
||||||
let errorMessage = ''
|
let errorMessage = ''
|
||||||
|
let rawBody = ''
|
||||||
while (attempt < this.maxAttempts) {
|
while (attempt < this.maxAttempts) {
|
||||||
let isRetryable = false
|
let isRetryable = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await operation()
|
const response = await operation()
|
||||||
const statusCode = response.message.statusCode
|
const statusCode = response.message.statusCode
|
||||||
debug(`[Response] ${response.message.statusCode}`)
|
rawBody = await response.readBody()
|
||||||
debug(JSON.stringify(response.message.headers, null, 2))
|
debug(`[Response] - ${response.message.statusCode}`)
|
||||||
|
debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`)
|
||||||
|
const body = JSON.parse(rawBody)
|
||||||
|
debug(`Body: ${JSON.stringify(body, null, 2)}`)
|
||||||
if (this.isSuccessStatusCode(statusCode)) {
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
return response
|
return {response, body}
|
||||||
}
|
}
|
||||||
|
|
||||||
isRetryable = this.isRetryableHttpStatusCode(statusCode)
|
isRetryable = this.isRetryableHttpStatusCode(statusCode)
|
||||||
errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`
|
errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`
|
||||||
|
if (body.msg) {
|
||||||
|
if (UsageError.isUsageErrorMessage(body.msg)) {
|
||||||
|
throw new UsageError()
|
||||||
|
}
|
||||||
|
|
||||||
|
errorMessage = `${errorMessage}: ${body.msg}`
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error instanceof SyntaxError) {
|
||||||
|
debug(`Raw Body: ${rawBody}`)
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error instanceof UsageError) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NetworkError.isNetworkErrorCode(error?.code)) {
|
||||||
|
throw new NetworkError(error?.code)
|
||||||
|
}
|
||||||
|
|
||||||
isRetryable = true
|
isRetryable = true
|
||||||
errorMessage = error.message
|
errorMessage = error.message
|
||||||
}
|
}
|
||||||
@@ -131,8 +154,7 @@ class ArtifactHttpClient implements Rpc {
|
|||||||
HttpCodes.GatewayTimeout,
|
HttpCodes.GatewayTimeout,
|
||||||
HttpCodes.InternalServerError,
|
HttpCodes.InternalServerError,
|
||||||
HttpCodes.ServiceUnavailable,
|
HttpCodes.ServiceUnavailable,
|
||||||
HttpCodes.TooManyRequests,
|
HttpCodes.TooManyRequests
|
||||||
413 // Payload Too Large
|
|
||||||
]
|
]
|
||||||
|
|
||||||
return retryableStatusCodes.includes(statusCode)
|
return retryableStatusCodes.includes(statusCode)
|
||||||
|
|||||||
@@ -35,3 +35,38 @@ export class GHESNotSupportedError extends Error {
|
|||||||
this.name = 'GHESNotSupportedError'
|
this.name = 'GHESNotSupportedError'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class NetworkError extends Error {
|
||||||
|
code: string
|
||||||
|
|
||||||
|
constructor(code: string) {
|
||||||
|
const message = `Unable to make request: ${code}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`
|
||||||
|
super(message)
|
||||||
|
this.code = code
|
||||||
|
this.name = 'NetworkError'
|
||||||
|
}
|
||||||
|
|
||||||
|
static isNetworkErrorCode = (code?: string): boolean => {
|
||||||
|
if (!code) return false
|
||||||
|
return [
|
||||||
|
'ECONNRESET',
|
||||||
|
'ENOTFOUND',
|
||||||
|
'ETIMEDOUT',
|
||||||
|
'ECONNREFUSED',
|
||||||
|
'EHOSTUNREACH'
|
||||||
|
].includes(code)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UsageError extends Error {
|
||||||
|
constructor() {
|
||||||
|
const message = `Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`
|
||||||
|
super(message)
|
||||||
|
this.name = 'UsageError'
|
||||||
|
}
|
||||||
|
|
||||||
|
static isUsageErrorMessage = (msg?: string): boolean => {
|
||||||
|
if (!msg) return false
|
||||||
|
return msg.includes('insufficient usage')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/*****************************************************************************
|
/**
|
||||||
* *
|
* Response from the server when an artifact is uploaded
|
||||||
* UploadArtifact *
|
*/
|
||||||
* *
|
|
||||||
*****************************************************************************/
|
|
||||||
export interface UploadArtifactResponse {
|
export interface UploadArtifactResponse {
|
||||||
/**
|
/**
|
||||||
* Total size of the artifact in bytes. Not provided if no artifact was uploaded
|
* Total size of the artifact in bytes. Not provided if no artifact was uploaded
|
||||||
@@ -16,6 +14,9 @@ export interface UploadArtifactResponse {
|
|||||||
id?: number
|
id?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options for uploading an artifact
|
||||||
|
*/
|
||||||
export interface UploadArtifactOptions {
|
export interface UploadArtifactOptions {
|
||||||
/**
|
/**
|
||||||
* Duration after which artifact will expire in days.
|
* Duration after which artifact will expire in days.
|
||||||
@@ -46,12 +47,9 @@ export interface UploadArtifactOptions {
|
|||||||
compressionLevel?: number
|
compressionLevel?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/**
|
||||||
* *
|
* Response from the server when getting an artifact
|
||||||
* GetArtifact *
|
*/
|
||||||
* *
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
export interface GetArtifactResponse {
|
export interface GetArtifactResponse {
|
||||||
/**
|
/**
|
||||||
* Metadata about the artifact that was found
|
* Metadata about the artifact that was found
|
||||||
@@ -59,12 +57,9 @@ export interface GetArtifactResponse {
|
|||||||
artifact: Artifact
|
artifact: Artifact
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/**
|
||||||
* *
|
* Options for listing artifacts
|
||||||
* ListArtifact *
|
*/
|
||||||
* *
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
export interface ListArtifactsOptions {
|
export interface ListArtifactsOptions {
|
||||||
/**
|
/**
|
||||||
* Filter the workflow run's artifacts to the latest by name
|
* Filter the workflow run's artifacts to the latest by name
|
||||||
@@ -73,6 +68,9 @@ export interface ListArtifactsOptions {
|
|||||||
latest?: boolean
|
latest?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response from the server when listing artifacts
|
||||||
|
*/
|
||||||
export interface ListArtifactsResponse {
|
export interface ListArtifactsResponse {
|
||||||
/**
|
/**
|
||||||
* A list of artifacts that were found
|
* A list of artifacts that were found
|
||||||
@@ -80,11 +78,9 @@ export interface ListArtifactsResponse {
|
|||||||
artifacts: Artifact[]
|
artifacts: Artifact[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/**
|
||||||
* *
|
* Response from the server when downloading an artifact
|
||||||
* DownloadArtifact *
|
*/
|
||||||
* *
|
|
||||||
*****************************************************************************/
|
|
||||||
export interface DownloadArtifactResponse {
|
export interface DownloadArtifactResponse {
|
||||||
/**
|
/**
|
||||||
* The path where the artifact was downloaded to
|
* The path where the artifact was downloaded to
|
||||||
@@ -92,6 +88,9 @@ export interface DownloadArtifactResponse {
|
|||||||
downloadPath?: string
|
downloadPath?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options for downloading an artifact
|
||||||
|
*/
|
||||||
export interface DownloadArtifactOptions {
|
export interface DownloadArtifactOptions {
|
||||||
/**
|
/**
|
||||||
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
|
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
|
||||||
@@ -99,11 +98,9 @@ export interface DownloadArtifactOptions {
|
|||||||
path?: string
|
path?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/**
|
||||||
* *
|
* An Actions Artifact
|
||||||
* Shared *
|
*/
|
||||||
* *
|
|
||||||
*****************************************************************************/
|
|
||||||
export interface Artifact {
|
export interface Artifact {
|
||||||
/**
|
/**
|
||||||
* The name of the artifact
|
* The name of the artifact
|
||||||
@@ -127,16 +124,26 @@ export interface Artifact {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FindOptions are for fetching Artifact(s) out of the scope of the current run.
|
// FindOptions are for fetching Artifact(s) out of the scope of the current run.
|
||||||
// Must specify a token with actions:read scope for cross run/repo lookup otherwise these will be ignored.
|
|
||||||
export interface FindOptions {
|
export interface FindOptions {
|
||||||
|
/**
|
||||||
|
* The criteria for finding Artifact(s) out of the scope of the current run.
|
||||||
|
*/
|
||||||
findBy?: {
|
findBy?: {
|
||||||
// Token with actions:read permissions
|
/**
|
||||||
|
* Token with actions:read permissions
|
||||||
|
*/
|
||||||
token: string
|
token: string
|
||||||
// WorkflowRun of the artifact(s) to lookup
|
/**
|
||||||
|
* WorkflowRun of the artifact(s) to lookup
|
||||||
|
*/
|
||||||
workflowRunId: number
|
workflowRunId: number
|
||||||
// Repository owner
|
/**
|
||||||
|
* Repository owner (eg. 'actions')
|
||||||
|
*/
|
||||||
repositoryOwner: string
|
repositoryOwner: string
|
||||||
// Repository name
|
/**
|
||||||
|
* Repository owner (eg. 'toolkit')
|
||||||
|
*/
|
||||||
repositoryName: string
|
repositoryName: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {getUploadChunkSize, getConcurrency} from '../shared/config'
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as crypto from 'crypto'
|
import * as crypto from 'crypto'
|
||||||
import * as stream from 'stream'
|
import * as stream from 'stream'
|
||||||
|
import {NetworkError} from '../shared/errors'
|
||||||
|
|
||||||
export interface BlobUploadResponse {
|
export interface BlobUploadResponse {
|
||||||
/**
|
/**
|
||||||
@@ -52,12 +53,20 @@ export async function uploadZipToBlobStorage(
|
|||||||
|
|
||||||
core.info('Beginning upload of artifact content to blob storage')
|
core.info('Beginning upload of artifact content to blob storage')
|
||||||
|
|
||||||
await blockBlobClient.uploadStream(
|
try {
|
||||||
uploadStream,
|
await blockBlobClient.uploadStream(
|
||||||
bufferSize,
|
uploadStream,
|
||||||
maxConcurrency,
|
bufferSize,
|
||||||
options
|
maxConcurrency,
|
||||||
)
|
options
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
if (NetworkError.isNetworkErrorCode(error?.code)) {
|
||||||
|
throw new NetworkError(error?.code)
|
||||||
|
}
|
||||||
|
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
core.info('Finished uploading artifact content to blob storage!')
|
core.info('Finished uploading artifact content to blob storage!')
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,6 @@ export async function uploadArtifact(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const zipUploadStream = await createZipUploadStream(
|
|
||||||
zipSpecification,
|
|
||||||
options?.compressionLevel
|
|
||||||
)
|
|
||||||
|
|
||||||
// get the IDs needed for the artifact creation
|
// get the IDs needed for the artifact creation
|
||||||
const backendIds = getBackendIdsFromToken()
|
const backendIds = getBackendIdsFromToken()
|
||||||
|
|
||||||
@@ -73,6 +68,11 @@ export async function uploadArtifact(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const zipUploadStream = await createZipUploadStream(
|
||||||
|
zipSpecification,
|
||||||
|
options?.compressionLevel
|
||||||
|
)
|
||||||
|
|
||||||
// Upload zip to blob storage
|
// Upload zip to blob storage
|
||||||
const uploadResult = await uploadZipToBlobStorage(
|
const uploadResult = await uploadZipToBlobStorage(
|
||||||
createArtifactResp.signedUploadUrl,
|
createArtifactResp.signedUploadUrl,
|
||||||
|
|||||||
@@ -358,3 +358,129 @@ const {
|
|||||||
version, // 10.0.22621
|
version, // 10.0.22621
|
||||||
} = await platform.getDetails()
|
} = await platform.getDetails()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Populating job summary
|
||||||
|
|
||||||
|
These methods can be used to populate a [job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary). A job summary is a buffer that can be added to throughout your job via `core.summary` methods.
|
||||||
|
|
||||||
|
Job summaries when complete must be written to the summary buffer file via the `core.summary.write()` method.
|
||||||
|
|
||||||
|
All methods except `addRaw()` utilize the `addRaw()` method to append to the buffer, followed by an EOL using the `addEOL()` method.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
// Write raw text, optionally add an EOL after the content, defaults to false
|
||||||
|
core.summary.addRaw('Some content here :speech_balloon:', true)
|
||||||
|
// Output: Some content here :speech_balloon:\n
|
||||||
|
|
||||||
|
// Add an operating system-specific end-of-line marker
|
||||||
|
core.summary.addEOL()
|
||||||
|
// Output (POSIX): \n
|
||||||
|
// Output (Windows): \r\n
|
||||||
|
|
||||||
|
// Add a codeblock with an optional language for syntax highlighting
|
||||||
|
core.summary.addCodeBlock('console.log(\'hello world\')', 'javascript')
|
||||||
|
// Output: <pre lang="javascript"><code>console.log('hello world')</code></pre>
|
||||||
|
|
||||||
|
// Add a list, second parameter indicates if list is ordered, defaults to false
|
||||||
|
core.summary.addList(['item1','item2','item3'], true)
|
||||||
|
// Output: <ol><li>item1</li><li>item2</li><li>item3</li></ol>
|
||||||
|
|
||||||
|
// Add a collapsible HTML details element
|
||||||
|
core.summary.addDetails('Label', 'Some detail that will be collapsed')
|
||||||
|
// Output: <details><summary>Label</summary>Some detail that will be collapsed</details>
|
||||||
|
|
||||||
|
// Add an image, image options parameter is optional, you can supply one of or both width and height in pixels
|
||||||
|
core.summary.addImage('example.png', 'alt description of img', {width: '100', height: '100'})
|
||||||
|
// Output: <img src="example.png" alt="alt description of img" width="100" height="100">
|
||||||
|
|
||||||
|
// Add an HTML section heading element, optionally pass a level that translates to 'hX' ie. h2. Defaults to h1
|
||||||
|
core.summary.addHeading('My Heading', '2')
|
||||||
|
// Output: <h2>My Heading</h2>
|
||||||
|
|
||||||
|
// Add an HTML thematic break <hr>
|
||||||
|
core.summary.addSeparator()
|
||||||
|
// Output: <hr>
|
||||||
|
|
||||||
|
// Add an HTML line break <br>
|
||||||
|
core.summary.addBreak()
|
||||||
|
// Output: <br>
|
||||||
|
|
||||||
|
// Add an HTML blockquote with an optional citation
|
||||||
|
core.summary.addQuote('To be or not to be', 'Shakespeare')
|
||||||
|
// Output: <blockquote cite="Shakespeare">To be or not to be</blockquote>
|
||||||
|
|
||||||
|
// Add an HTML anchor tag
|
||||||
|
core.summary.addLink('click here', 'https://github.com')
|
||||||
|
// Output: <a href="https://github.com">click here</a>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Tables are added using the `addTable()` method, and an array of `SummaryTableRow`.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
export type SummaryTableRow = (SummaryTableCell | string)[]
|
||||||
|
|
||||||
|
export interface SummaryTableCell {
|
||||||
|
/**
|
||||||
|
* Cell content
|
||||||
|
*/
|
||||||
|
data: string
|
||||||
|
/**
|
||||||
|
* Render cell as header
|
||||||
|
* (optional) default: false
|
||||||
|
*/
|
||||||
|
header?: boolean
|
||||||
|
/**
|
||||||
|
* Number of columns the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
colspan?: string
|
||||||
|
/**
|
||||||
|
* Number of rows the cell extends
|
||||||
|
* (optional) default: '1'
|
||||||
|
*/
|
||||||
|
rowspan?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
For example
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
const tableData = [
|
||||||
|
{data: 'Header1', header: true},
|
||||||
|
{data: 'Header2', header: true},
|
||||||
|
{data: 'Header3', header: true},
|
||||||
|
{data: 'MyData1'},
|
||||||
|
{data: 'MyData2'},
|
||||||
|
{data: 'MyData3'}
|
||||||
|
]
|
||||||
|
|
||||||
|
// Add an HTML table
|
||||||
|
core.summary.addTable([tableData])
|
||||||
|
// Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr></tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
In addition to job summary content, there are utility functions for interfacing with the buffer.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
|
||||||
|
// Empties the summary buffer AND wipes the summary file on disk
|
||||||
|
core.summary.clear()
|
||||||
|
|
||||||
|
// Returns the current summary buffer as a string
|
||||||
|
core.summary.stringify()
|
||||||
|
|
||||||
|
// If the summary buffer is empty
|
||||||
|
core.summary.isEmptyBuffer()
|
||||||
|
|
||||||
|
// Resets the summary buffer without writing to the summary file on disk
|
||||||
|
core.summary.emptyBuffer()
|
||||||
|
|
||||||
|
// Writes text in the buffer to the summary buffer file and empties the buffer, optionally overwriting all existing content in the summary file with buffer contents. Defaults to false.
|
||||||
|
core.summary.write({overwrite: true})
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user