mirror of https://github.com/actions/toolkit
Simplify to id instead of ArtifactId
parent
d830aca920
commit
5fea8616de
|
@ -122,14 +122,14 @@ jobs:
|
||||||
}
|
}
|
||||||
|
|
||||||
const artifactNames = artifacts.map(artifact => artifact.name)
|
const artifactNames = artifacts.map(artifact => artifact.name)
|
||||||
if (!artifactNames.contains('my-artifact-ubuntu-latest')){
|
if (!artifactNames.includes('my-artifact-ubuntu-latest')){
|
||||||
throw new Error('Expected artifact list to contain an artifact named my-artifact-ubuntu-latest but it did not find one')
|
throw new Error("Expected artifact list to contain an artifact named my-artifact-ubuntu-latest but it's missing")
|
||||||
}
|
}
|
||||||
if (!artifactNames.contains('my-artifact-windows-latest')){
|
if (!artifactNames.includes('my-artifact-windows-latest')){
|
||||||
throw new Error('Expected artifact list to contain an artifact named my-artifact-windows-latest but it did not find one')
|
throw new Error("Expected artifact list to contain an artifact named my-artifact-windows-latest but it's missing")
|
||||||
}
|
}
|
||||||
if (!artifactNames.contains('my-artifact-macos-latest')){
|
if (!artifactNames.includes('my-artifact-macos-latest')){
|
||||||
throw new Error('Expected artifact list to contain an artifact named my-artifact-macos-latest but it did not find one')
|
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')
|
||||||
|
|
|
@ -29,7 +29,7 @@ export async function listArtifacts(
|
||||||
repositoryName: string,
|
repositoryName: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<ListArtifactsResponse> {
|
): Promise<ListArtifactsResponse> {
|
||||||
info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}\\${repositoryName}`)
|
info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`)
|
||||||
|
|
||||||
const artifacts: Artifact[] = []
|
const artifacts: Artifact[] = []
|
||||||
const [retryOpts, requestOpts] = getRetryOptions(
|
const [retryOpts, requestOpts] = getRetryOptions(
|
||||||
|
@ -73,7 +73,7 @@ export async function listArtifacts(
|
||||||
listArtifactResponse.artifacts.forEach(artifact => {
|
listArtifactResponse.artifacts.forEach(artifact => {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
artifactId: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
|
@ -100,7 +100,7 @@ export async function listArtifacts(
|
||||||
listArtifactResponse.artifacts.forEach(artifact => {
|
listArtifactResponse.artifacts.forEach(artifact => {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
artifactId: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
|
|
|
@ -114,7 +114,7 @@ export interface Artifact {
|
||||||
/**
|
/**
|
||||||
* The ID of the artifact
|
* The ID of the artifact
|
||||||
*/
|
*/
|
||||||
artifactId: number
|
id: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL of the artifact
|
* The URL of the artifact
|
||||||
|
|
Loading…
Reference in New Issue