Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List artifacts using @actions/artifact #379

Closed
konradpabjan opened this issue Mar 12, 2020 · 1 comment
Closed

List artifacts using @actions/artifact #379

konradpabjan opened this issue Mar 12, 2020 · 1 comment
Labels
artifact enhancement New feature or request

Comments

@konradpabjan
Copy link
Contributor

It is currently possible to list artifacts for a workflow run using the GitHub API: https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts

This API is limited though because Artifacts will only be listed after a run is complete.

The @actions/artifact package should add a public listArtifacts() method that will allow users to get a list of artifacts during a run

@konradpabjan
Copy link
Contributor Author

v2.0.0 of @actions/artifact which was recently released has a listArtifacts method!

/**
* 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
*
* @param options Extra options that allow for the customization of the list behavior
* @returns ListArtifactResponse object
*/
listArtifacts(
options?: ListArtifactsOptions & FindOptions
): Promise<ListArtifactsResponse>

https://github.com/actions/toolkit/tree/main/packages/artifact#downloading-from-other-workflow-runs-or-repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifact enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@konradpabjan @thboop and others