mirror of
https://github.com/actions/upload-artifact.git
synced 2025-06-14 15:57:12 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
83fd05a356 | |||
3cea537223 | |||
849aa7758a | |||
4d3986961d | |||
2e0d362ec5 | |||
09a5d6a283 | |||
189315d910 | |||
d159c2d80b | |||
c26a7ba4b5 | |||
6ed6c72922 | |||
2aeee267b2 | |||
0e2226cf92 | |||
f29a5d04a6 | |||
6673cd052c | |||
2244c82003 | |||
87348cee5f |
2
.licenses/npm/@actions/artifact.dep.yml
generated
2
.licenses/npm/@actions/artifact.dep.yml
generated
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/artifact"
|
||||
version: 0.6.1
|
||||
version: 1.1.0
|
||||
type: npm
|
||||
summary:
|
||||
homepage:
|
||||
|
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/core"
|
||||
version: 1.2.6
|
||||
version: 1.10.0
|
||||
type: npm
|
||||
summary: Actions core lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||
|
42
README.md
42
README.md
@ -1,4 +1,4 @@
|
||||
# Upload-Artifact v2
|
||||
# Upload-Artifact v3
|
||||
|
||||
This uploads artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete.
|
||||
|
||||
@ -34,7 +34,7 @@ steps:
|
||||
|
||||
- run: echo hello > path/to/artifact/world.txt
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: path/to/artifact/world.txt
|
||||
@ -43,7 +43,7 @@ steps:
|
||||
### Upload an Entire Directory
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: path/to/artifact/ # or path/to/artifact
|
||||
@ -52,7 +52,7 @@ steps:
|
||||
### Upload using a Wildcard Pattern
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: path/**/[abc]rtifac?/*
|
||||
@ -61,7 +61,7 @@ steps:
|
||||
### Upload using Multiple Paths and Exclusions
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: |
|
||||
@ -97,7 +97,7 @@ The [@actions/artifact](https://github.com/actions/toolkit/tree/main/packages/ar
|
||||
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@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: path/to/artifact/
|
||||
@ -109,7 +109,7 @@ If a path (or paths), result in no files being found for the artifact, the actio
|
||||
To upload artifacts only when the previous step of a job failed, use [`if: failure()`](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-status-check-functions):
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: my-artifact
|
||||
@ -121,7 +121,7 @@ To upload artifacts only when the previous step of a job failed, use [`if: failu
|
||||
You can upload an artifact without specifying a name
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: path/to/artifact/world.txt
|
||||
```
|
||||
@ -134,23 +134,21 @@ With the following example, the available artifact (named `artifact` by default
|
||||
|
||||
```yaml
|
||||
- run: echo hi > world.txt
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: world.txt
|
||||
|
||||
- run: echo howdy > extra-file.txt
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: extra-file.txt
|
||||
|
||||
- run: echo hello > world.txt
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: world.txt
|
||||
```
|
||||
|
||||
> **_Warning:_** Be careful when uploading to the same artifact via multiple jobs as artifacts may become corrupted
|
||||
|
||||
Each artifact behaves as a file share. Uploading to the same artifact multiple times in the same workflow can overwrite and append already uploaded files:
|
||||
|
||||
```yaml
|
||||
@ -161,16 +159,18 @@ Each artifact behaves as a file share. Uploading to the same artifact multiple t
|
||||
- name: Create a file
|
||||
run: echo ${{ matrix.node-version }} > my_file.txt
|
||||
- name: Accidentally upload to the same artifact via multiple jobs
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: ${{ github.workspace }}
|
||||
```
|
||||
|
||||
> **_Warning:_** Be careful when uploading to the same artifact via multiple jobs as artifacts may become corrupted. When uploading a file with an identical name and path in multiple jobs, uploads may fail with 503 errors due to conflicting uploads happening at the same time. Ensure uploads to identical locations to not interfere with each other.
|
||||
|
||||
In the above example, four jobs will upload four different files to the same artifact but there will only be one file available when `my-artifact` is downloaded. Each job overwrites what was previously uploaded. To ensure that jobs don't overwrite existing artifacts, use a different name per job:
|
||||
|
||||
```yaml
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact ${{ matrix.node-version }}
|
||||
path: ${{ github.workspace }}
|
||||
@ -184,9 +184,9 @@ 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@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Artifacts-V2
|
||||
name: Artifacts-V3
|
||||
path: ~/new/**/*
|
||||
```
|
||||
|
||||
@ -199,7 +199,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@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.name }}-name
|
||||
path: ${{ github.workspace }}/artifact/**/*
|
||||
@ -213,7 +213,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@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact
|
||||
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
|
||||
@ -228,7 +228,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@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: my_file.txt
|
||||
@ -270,7 +270,7 @@ If file permissions and case sensitivity are required, you can `tar` all of your
|
||||
run: tar -cvf my_files.tar /path/to/my/directory
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: my_files.tar
|
||||
|
@ -24,5 +24,5 @@ inputs:
|
||||
Minimum 1 day.
|
||||
Maximum 90 days unless changed from the repository settings page.
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
3497
dist/index.js
vendored
3497
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
9926
package-lock.json
generated
9926
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "upload-artifact",
|
||||
"version": "2.0.1",
|
||||
"version": "3.0.0",
|
||||
"description": "Upload a build artifact that can be used by subsequent workflow steps",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
@ -29,8 +29,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/actions/upload-artifact#readme",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^0.6.1",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/artifact": "^1.1.0",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/io": "^1.0.2"
|
||||
},
|
||||
|
Reference in New Issue
Block a user