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.
actions/upload-artifact |
geekyeggo/delete-artifact |
---|---|
@v1 , @v2 , @v3 |
@v1 , @v2 |
@v4 |
@v4 |
See action.yml
Important
Support for actions/upload-artifact@v4
utilizes the GitHub REST API, and requires a permissive GITHUB_TOKEN
, or a PAT with read and write access to actions.
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@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: my-artifact
steps:
- uses: geekyeggo/delete-artifact@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: |
artifact-*
binary-file
output
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@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: okay-to-keep
failOnError: false