Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

⚙️ A GitHub Action to download an artifact associated with given workflow and commit or other criteria

License

NotificationsYou must be signed in to change notification settings

dawidd6/action-download-artifact

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

An action that downloads and extracts uploaded artifacts associated with a given workflow and commit or other criteria.

Let's suppose you have a workflow with a job in it that at the end uploads an artifact usingactions/upload-artifact action and you want to download this artifact in another workflow that is run after the first one. Officialactions/download-artifact does not allow this. That's why I decided to create this action. By knowing only the workflow name and commit SHA or other details, you can download the previously uploaded artifact from different workflow associated with that commit or other criteria and use it.

Usage

Ifcommit,pr,branch,ref,run_id orworkflow_conclusion is not specified then the artifact from the most recent successfully completed workflow run will be downloaded.

Do not specifypr,commit,branch,ref,run_id together orworkflow_conclusion andrun_id together. Pick just one of each or none.

-name:Download artifactid:download-artifactuses:dawidd6/action-download-artifact@v11with:# 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 workflowworkflow:workflow_name.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 workflowworkflow_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 searchworkflow_conclusion:success# Optional, will get head commit SHApr:${{github.event.pull_request.number}}# Optional, no need to specify if PR iscommit:${{github.event.pull_request.head.sha}}# Optional, will use the specified branch. Defaults to all branchesbranch:master# Optional, branch/tag/commit ID to reference. This can supersede both# branch and commit above.ref:master# Optional, defaults to all typesevent: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 runrun_id:1122334455# Optional, run number from the workflowrun_number:34# 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_expressionsname:artifact_name# Optional, name is treated as a regular expression if set truename_is_regexp:true# Optional, a directory where to extract artifact(s), defaults to the current directorypath:extract_here# Optional, defaults to current reporepo:${{ 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 onecheck_artifacts:false# Optional, search for the last workflow run whose stored an artifact named as in `name` input# default falsesearch_artifacts:false# Optional, choose to skip unpacking the downloaded artifact(s)# default falseskip_unpack:false# Optional, choose how to exit the action if no artifact is found# can be one of:#  "fail", "warn", "ignore"# default failif_no_artifact_found:fail# Optional, include forks when searching for artifacts# default falseallow_forks:true# Optional, choose to unpack the downloaded artifact(s) using `unzip` system utility# default falseuse_unzip:false# Optional, if multiple artifacts are found with `name_is_regexp` set to `true`, merge them into one directory# default falsemerge_multiple:false

Troubleshooting

GLIBC_2.28 not found

v3 release of this action switched fromnode16 tonode20 as runtime.Node 20 requiresglibc>=2.28. If your self-hosted runner has olderglibc, pin tov2 release, but note it won't receive any updates.

About

⚙️ A GitHub Action to download an artifact associated with given workflow and commit or other criteria

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp