Skip to content

Commit

Permalink
Merge pull request #34 from joutvhu/develop
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
joutvhu authored Jan 20, 2024
2 parents dfe0969 + e5e001e commit d96d12c
Show file tree
Hide file tree
Showing 13 changed files with 117,111 additions and 21,113 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ updates:
- "joutvhu"
ignore:
- dependency-name: "@types/node"
- dependency-name: "@actions/artifact"
labels:
- "dependency"
target-branch: "develop"
6 changes: 4 additions & 2 deletions .github/workflows/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ jobs:
steps:
- name: Create test file
run: echo Hello, world! > hello.txt

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-artifact
path: hello.txt

- name: Detele artifact
uses: joutvhu/delete-artifact@v1
uses: joutvhu/delete-artifact@v2
with:
name: test-artifact
22 changes: 11 additions & 11 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,36 @@ jobs:
run: echo Hello, world! > hello.txt

- name: Upload single artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-single-artifact
name: test4-single-artifact
path: hello.txt
- name: Detele single artifact
uses: ./
with:
name: test-single-artifact
name: test4-single-artifact

- name: Upload artifact m1
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-m1-artifact
name: test4-m1-artifact
path: hello.txt
- name: Upload artifact m2
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-m2-artifact
name: test4-m2-artifact
path: hello.txt
- name: Detele multiple artifact
uses: ./
with:
name: |
test-m1-artifact
test-m2-artifact
test4-m1-artifact
test4-m2-artifact
- name: Upload artifact m3
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-m3-artifact
name: test4-m3-artifact
path: hello.txt

- name: Detele all artifact
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ This GitHub Action to delete artifacts from your build. This can be useful when

See also [upload-artifact](https://github.com/actions/upload-artifact).

## v2 - What's new

> [!IMPORTANT]
> delete-artifact@v2 is not currently supported on GHES yet. If you are on GHES, you must use [v1](https://github.com/joutvhu/delete-artifact/releases/tag/v1).
If the artifacts are uploaded using actions/upload-artifact@v3- then use joutvhu/delete-artifact@v1

If the artifacts are uploaded using actions/upload-artifact@v4+ then use joutvhu/delete-artifact@v2

## Usage

See [action.yml](action.yml)
Expand All @@ -12,9 +21,7 @@ See [action.yml](action.yml)

```yaml
steps:
- uses: actions/checkout@v2

- uses: joutvhu/delete-artifact@v1
- uses: joutvhu/delete-artifact@v2
with:
name: my-artifact
```
Expand All @@ -25,9 +32,7 @@ Deleting multiple artifacts within a single action can be achieved by specifying
```yaml
steps:
- uses: actions/checkout@v2

- uses: joutvhu/delete-artifact@v1
- uses: joutvhu/delete-artifact@v2
with:
name: |
artifact-1
Expand All @@ -40,7 +45,5 @@ If you don't specify an artifact `name` this Action will be deleted all found ar

```yaml
steps:
- uses: actions/checkout@v2
- uses: joutvhu/delete-artifact@v1
- uses: joutvhu/delete-artifact@v2
```
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ name: Delete Build Artifact
description: Delete a build artifact that was previously uploaded in the workflow by the upload-artifact action
author: Giao Ho
inputs:
owner:
# Default: Current owner
description: The name of the owner of the repo. Used to identify the owner of the repository.
required: false
repo:
# Default: Current repository
description: The name of the repository. Used to identify the repository on which to release.
required: false
runId:
description: WorkflowRun of the artifact(s) to lookup
required: false
token:
description: Token with actions:read permissions
required: false
latest:
description: Filter the workflow run's artifacts to the latest by name In the case of reruns, this can be useful to avoid duplicates
required: false
name:
description: The name of the artifact to delete, multiple names can be supplied on new lines.
required: false
Expand Down
Loading

0 comments on commit d96d12c

Please sign in to comment.