Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ You are welcome to still raise bugs in this repo.
### Inputs

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
Expand Down Expand Up @@ -160,7 +160,7 @@ You are welcome to still raise bugs in this repo.
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: path/to/artifact/world.txt
Expand All @@ -169,7 +169,7 @@ steps:
### Upload an Entire Directory

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: path/to/artifact/ # or path/to/artifact
Expand All @@ -178,7 +178,7 @@ steps:
### Upload using a Wildcard Pattern

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: path/**/[abc]rtifac?/*
Expand All @@ -187,7 +187,7 @@ steps:
### Upload using Multiple Paths and Exclusions

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: |
Expand Down Expand Up @@ -235,7 +235,7 @@ For instance, if you are uploading random binary data, you can save a lot of tim
- name: Make a 1GB random binary file
run: |
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: my-1gb-file
Expand All @@ -248,7 +248,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
- name: Make a file with a lot of repeated text
run: |
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: foobar.txt
Expand All @@ -260,7 +260,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
path: path/to/artifact/
Expand All @@ -273,13 +273,13 @@ Unlike earlier versions of `upload-artifact`, uploading to the same artifact via

```yaml
- run: echo hi > world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
# implicitly named as 'artifact'
path: world.txt

- run: echo howdy > extra-file.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
# also implicitly named as 'artifact', will fail here!
path: extra-file.txt
Expand All @@ -305,7 +305,7 @@ jobs:
- name: Build
run: ./some-script --version=${{ matrix.version }} > my-binary
- name: Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: binary-${{ matrix.os }}-${{ matrix.version }}
path: my-binary
Expand All @@ -323,7 +323,7 @@ You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expan
- run: |
mkdir -p ~/new/artifact
echo hello > ~/new/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifacts
path: ~/new/**/*
Expand All @@ -338,7 +338,7 @@ Environment variables along with context expressions can also be used for input.
- run: |
mkdir -p ${{ github.workspace }}/artifact
echo hello > ${{ github.workspace }}/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: ${{ env.name }}-name
path: ${{ github.workspace }}/artifact/**/*
Expand All @@ -352,7 +352,7 @@ For environment variables created in other steps, make sure to use the `env` exp
mkdir testing
echo "This is a file to upload" > testing/file.txt
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: artifact
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
Expand All @@ -367,7 +367,7 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti
run: echo "I won't live long" > my_file.txt

- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: my-artifact
path: my_file.txt
Expand All @@ -383,7 +383,7 @@ If an artifact upload is successful then an `artifact-id` output is available. T
#### Example output between steps

```yml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
id: artifact-upload-step
with:
name: my-artifact
Expand All @@ -402,7 +402,7 @@ jobs:
outputs:
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
steps:
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
id: artifact-upload-step
with:
name: my-artifact
Expand All @@ -428,7 +428,7 @@ jobs:
- name: Create a file
run: echo "hello world" > my-file.txt
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: my-artifact # NOTE: same artifact name
path: my-file.txt
Expand All @@ -439,7 +439,7 @@ jobs:
- name: Create a different file
run: echo "goodbye world" > my-file.txt
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: my-artifact # NOTE: same artifact name
path: my-file.txt
Expand All @@ -455,7 +455,7 @@ Any files that contain sensitive information that should not be in the uploaded
using the `path`:

```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: my-artifact
include-hidden-files: true
Expand Down Expand Up @@ -491,7 +491,7 @@ If you must preserve permissions, you can `tar` all of your files together befor
run: tar -cvf my_files.tar /path/to/my/directory

- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: my-artifact
path: my_files.tar
Expand Down