mirror of
https://github.com/actions/download-artifact.git
synced 2025-04-25 16:46:43 +08:00
Merge pull request #402 from actions/joshmgross/download-by-id-example
Fix workflow example for downloading by artifact ID
This commit is contained in:
commit
77454371a4
4
.github/workflows/check-dist.yml
vendored
4
.github/workflows/check-dist.yml
vendored
@ -10,11 +10,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -219,21 +219,29 @@ To take advantage of this immutability for security purposes (to avoid potential
|
|||||||
jobs:
|
jobs:
|
||||||
upload:
|
upload:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# Make the artifact ID available to the download job
|
||||||
|
outputs:
|
||||||
|
artifact-id: ${{ steps.upload-step.outputs.artifact-id }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Create a file
|
- name: Create a file
|
||||||
run: echo "hello world" > my-file.txt
|
run: echo "hello world" > my-file.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
id: upload
|
id: upload-step
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: my-file.txt
|
path: my-file.txt
|
||||||
# The upload step outputs the artifact ID
|
# The upload step outputs the artifact ID
|
||||||
- name: Print Artifact ID
|
- name: Print Artifact ID
|
||||||
run: echo "Artifact ID is ${{ steps.upload.outputs.artifact-id }}"
|
run: echo "Artifact ID is ${{ steps.upload-step.outputs.artifact-id }}"
|
||||||
|
|
||||||
download:
|
download:
|
||||||
needs: upload
|
needs: upload
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifact by ID
|
- name: Download Artifact by ID
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user