getArtifact

abstract fun getArtifact(artifactName: String, options: FindOptions = definedExternally): Promise<GetArtifactResponse>(source)

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

artifactName

The name of the artifact to find

options

Extra options that allow for the customization of the get behavior