Skip to content

Add methods to delete artifacts#1626

Merged
robherley merged 6 commits into
mainfrom
robherley/delete-artifacts
Jan 18, 2024
Merged

Add methods to delete artifacts#1626
robherley merged 6 commits into
mainfrom
robherley/delete-artifacts

Conversation

@robherley

@robherley robherley commented Jan 17, 2024

Copy link
Copy Markdown
Contributor

Having official client methods to delete artifacts will make some use cases much simpler.
For instance, this could allow the ability to overwrite an artifact eventually in actions/upload-artifact.

e.g.

- uses: actions/upload-artifact@v4
  with:
    name: my-artifact
    path: path/to/artifact/
    overwrite: true # something like this

Where overwrite would delete an artifact first, allowing for the upload of another.

I'll update the documentation in a separate PR.

Closes: #380
Partially supports: actions/upload-artifact#471

@robherley
robherley marked this pull request as ready for review January 17, 2024 23:32
@robherley
robherley requested review from a team as code owners January 17, 2024 23:32
Comment thread packages/artifact/README.md Outdated
Comment thread packages/artifact/src/internal/client.ts
@robherley
robherley merged commit daf23ba into main Jan 18, 2024

return deleteArtifactInternal(artifactName)
} catch (error) {
warning(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no await for deleteArtifactPublic / deleteArtifactInternal is this warning actually printed when something goes wrong asynchronously? To me it looks this only catches errors which are thrown synchronously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Artifacts using @actions/artifact

4 participants