Skip to content

Delete Artifact

Actions
Delete artifacts created within the workflow run
v5.1.0
Latest
Star (203)

CI Example

Delete artifacts

A GitHub Action for deleting artifacts within the workflow run. This can be useful when artifacts are shared across jobs, but are no longer needed when the workflow is complete.

✅ Compatibility

actions/upload-artifact geekyeggo/delete-artifact
@v1, @v2, @v3 @v1, @v2
@v4 @v4, @v5

Tip

You can reference the immutable commit SHA, instead of a version, for example.

- uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0

⚡ Usage

See action.yml

Delete an individual artifact

steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Create test file
      run: echo hello > test.txt

    - uses: actions/upload-artifact@v4
      with:
          name: my-artifact
          path: test.txt

    - uses: geekyeggo/delete-artifact@v5
      with:
          name: my-artifact

Specify multiple names

steps:
    - uses: geekyeggo/delete-artifact@v5
      with:
          name: |
              artifact-*
              binary-file
              output

🚨 Error vs Fail

By default, the action will fail when it was not possible to delete an artifact (with the exception of name mismatches). When the deletion of an artifact is not integral to the success of a workflow, it is possible to error without failure. All errors are logged.

steps:
    - uses: geekyeggo/delete-artifact@v5
      with:
          name: okay-to-keep
          failOnError: false

Delete Artifact is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Delete artifacts created within the workflow run
v5.1.0
Latest

Delete Artifact is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.