• Stars
    star
    668
  • Rank 67,058 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

βš™οΈ A GitHub Action to download an artifact associated with given workflow and commit or other criteria

Download workflow artifact GitHub Action

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 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 or other details, you can download the previously uploaded artifact from different workflow associated with that commit or other criteria and use it.

Usage

If commit or pr or branch or run_id or workflow_conclusion is not specified then the artifact from the most recent successfully completed workflow run will be downloaded.

Do not specify pr, commit, branch, run_id together or workflow_conclusion and run_id together. Pick just one of each or none.

- name: Download artifact
  id: download-artifact
  uses: dawidd6/action-download-artifact@v2
  with:
    # 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: workflow_name.yml
    # 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: 1122334455
    # Optional, run number from the workflow
    run_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_expressions
    name: artifact_name
    # Optional, name is treated as a regular expression if set true
    name_is_regexp: true
    # Optional, a directory where to extract artifact(s), defaults to the current directory
    path: extract_here
    # 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

More Repositories

1

action-send-mail

βš™οΈ A GitHub Action to send an email to multiple recipients
JavaScript
417
star
2

action-ansible-playbook

βš™οΈ A GitHub Action for running Ansible playbooks
JavaScript
262
star
3

action-homebrew-bump-formula

βš™οΈ A GitHub Action to easily bump Homebrew formula on new release
Ruby
88
star
4

action-get-tag

βš™οΈ A GitHub Action to get the pushed tag name
JavaScript
39
star
5

action-debian-package

βš™οΈ A GitHub Action for building Debian packages
JavaScript
23
star
6

deber

πŸ“¦πŸ‹ Debian packaging with Docker
Go
23
star
7

Brewery

🍺 Cross-platform frontend to Homebrew formulae API
Dart
21
star
8

go-appindicator

πŸš₯ Go bindings for libappindicator3 C library
Go
19
star
9

AndTTT

🎲 Simple tic tac toe game for Android
Java
18
star
10

homebrew-tap

🍺 Homebrew tap for my (and not) software
Ruby
14
star
11

seedbox

rTorrent + ruTorrent + Webserver + XMLRPC-C (un)installation script
Shell
12
star
12

action-publish-gem

βš™οΈ A GitHub Action to build and publish a Ruby gem
Ruby
11
star
13

debian-vscode

🍬 Debian packaging files syntax highlighting support for VSCode
10
star
14

checksumo

πŸ“ A simple application for verifying specified file against given hash, written in Go with GTK+3 graphical interface
Go
9
star
15

action-delete-branch

βš™οΈ A GitHub Action to delete multiple branches
JavaScript
8
star
16

nix

❄️ My NixOS and home-manager configurations
Nix
5
star
17

homebrew-autoremove

πŸΊβ›” Homebrew autoremove external command
Ruby
5
star
18

action-checkout-pr

βš™οΈ A GitHub Action to checkout a pull request with ability to push back
JavaScript
5
star
19

action-docker-publish-changed

βš™οΈ A GitHub Action to build and publish multi platform Docker images based on changed paths
JavaScript
4
star
20

go-spotify-dbus

🎢 Simple library that helps interacting with Spotify dbus interface
Go
4
star
21

homebrew-update-pypi-resources

🍺🐍 Homebrew external command to update python pypi resources in formulae
Ruby
3
star
22

action-git-user-config

βš™οΈ A GitHub Action to configure git for given user
JavaScript
3
star
23

indicator-net

πŸ“Š Ubuntu (unity) panel indicator
C
3
star
24

actions-updater

πŸ› οΈ Updater of used GitHub Actions in workflow files
Ruby
3
star
25

ba-bump

🍺 Automatic Homebrew formulae bumping
2
star
26

dawidd6

πŸ‘€ About me
2
star
27

minifetch

Minimal system info fetcher
Shell
2
star
28

qtictactoe

🎲 Simple tictactoe game
C++
2
star
29

dotfiles

πŸ’» Config files
Shell
1
star
30

docker

πŸ‹ Some useful Dockerfiles and Compose files
Dockerfile
1
star
31

indicator-mpd

πŸ“Š Ubuntu (unity) panel indicator
C
1
star
32

go-mmap

πŸ“¦ Concurrent-safe map[interface{}]interface{}
Go
1
star
33

ansible

πŸ”§ Ansible playbooks
Shell
1
star
34

indicator-spotify

πŸ“Š Ubuntu (unity) panel indicator
C
1
star
35

action-git-try-push

βš™οΈ A GitHub Action to push changes with tries count
JavaScript
1
star
36

p2p

πŸ“‚ A P2P file sharing system, based on gRPC
Go
1
star