Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

pv-platforma/action-download-artifact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Download workflow artifact GitHub Action

An action that downloads and extracts uploaded artifact associated with given workflow and commit.

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

Usage

If commit or pr or branch is not specified then the artifact from the most recent completed workflow run will be downloaded. If branch is specified, it will ignore any value set for commit and pr.

- name: Download artifact
  uses: dawidd6/action-download-artifact@v2
  with:
    # Optional, GitHub token
    github_token: ${{secrets.GITHUB_TOKEN}}
    # Required, workflow file name or ID
    workflow: workflow_name.yml
    # 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 branch
    branch: master
    # Required, uploaded artifact name
    name: artifact_name
    # Optional, directory where to extract artifact
    path: extract_here
    # Optional, defaults to current repo
    repo: ${{github.repository}}

About

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

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%