A GitHub Action to deletes artifacts within the workflow run.
  • TypeScript 100%
Find a file
dependabot[bot] e46cfb9575
build(deps): bump @actions/artifact from 2.1.4 to 2.1.7 (#27)
Bumps [@actions/artifact](https://github.com/actions/toolkit/tree/HEAD/packages/artifact) from 2.1.4 to 2.1.7.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/artifact/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/artifact)

---
updated-dependencies:
- dependency-name: "@actions/artifact"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:30:28 +01:00
.github build: update ci to v5 2024-03-18 12:59:42 +00:00
dist chore: bump deps (closes #26) 2024-08-31 17:37:21 +01:00
src refactor: remove unused global declarations 2024-03-18 11:37:14 +00:00
.editorconfig feat: adds support for actions/upload-artifact@v4 (#17) (fixed #14) 2023-12-24 18:41:48 +00:00
.gitignore Update dev environment 2022-10-12 14:04:07 +01:00
action.yml chore: mark deprecated token as optional 2024-08-31 17:38:49 +01:00
CHANGELOG.md docs: bump v5.1 2024-08-31 17:42:34 +01:00
LICENSE refactor: update repo selection 2023-12-24 19:57:54 +00:00
package-lock.json build(deps): bump @actions/artifact from 2.1.4 to 2.1.7 (#27) 2024-09-05 17:30:28 +01:00
package.json build(deps): bump @actions/artifact from 2.1.4 to 2.1.7 (#27) 2024-09-05 17:30:28 +01:00
README.md docs: add commit sha for 5.1.0 2024-08-31 17:56:02 +01:00
tsconfig.json Add glob support, switch to TypeScript, and bump deps 2022-10-12 14:08:28 +01:00

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