Skip to content

Download Artifact from Previous Workflow #7

Download Artifact from Previous Workflow

Download Artifact from Previous Workflow #7

Workflow file for this run

name: Download Artifact from Previous Workflow
on:
workflow_run:
workflows: ["Build Web"]
types:
- completed
workflow_dispatch:
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build_web.yml
workflow_conclusion: success
search_artifacts: true
name: web-build
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
# github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
# workflow: build.yml
# If no workflow is set and workflow_search set to true, then the most recent workflow matching
# all other criteria will be looked up instead of using the current workflow
# workflow_search: false
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
# workflow_conclusion: success
# Optional, will get head commit SHA
# pr: ${{github.event.pull_request.number}}
# Optional, no need to specify if PR is
# commit: ${{github.event.pull_request.head.sha}}
# Optional, will use the specified branch. Defaults to all branches
# branch: master
# Optional, defaults to all types
# event: push
# Optional, will use specified workflow run
# use ${{ github.event.workflow_run.id }} when your action runs in a workflow_run event
# and wants to download from the triggering workflow run
# run_id: ${{ github.event.workflow_run.id }}
# Optional, uploaded artifact name,
# will download all artifacts if not specified
# and extract them into respective subdirectories
# https://github.com/actions/download-artifact#download-all-artifacts
# is treated as a regular expression if input name_is_regexp is true
# will download only those artifacts with a name that matches this regular expression
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
# name: WEB_BUILD
# Optional, name is treated as a regular expression if set true
# name_is_regexp: true
# Optional, defaults to current repo
# repo: ${{ github.repository }}
# Optional, check the workflow run to whether it has an artifact
# then will get the last available artifact from the previous workflow
# default false, just try to download from the last one
# check_artifacts: false
# Optional, search for the last workflow run whose stored an artifact named as in `name` input
# default false
# search_artifacts: false
# Optional, choose to skip unpacking the downloaded artifact(s)
# default false
# skip_unpack: false
# Optional, choose how to exit the action if no artifact is found
# can be one of:
# "fail", "warn", "ignore"
# default fail
if_no_artifact_found: fail
# - name: Download Artifact
# uses: actions/download-artifact@v4
# with:
# name: WEB_BUILD