https://github.com/duhow/download-github-release-assets
Github Action to download GitHub release assets
https://github.com/duhow/download-github-release-assets
artifact github-action github-actions github-release
Last synced: 10 months ago
JSON representation
Github Action to download GitHub release assets
- Host: GitHub
- URL: https://github.com/duhow/download-github-release-assets
- Owner: duhow
- License: mit
- Created: 2021-08-30T14:36:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T15:32:28.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T01:44:34.342Z (10 months ago)
- Topics: artifact, github-action, github-actions, github-release
- Language: JavaScript
- Homepage:
- Size: 224 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/duhow/download-github-release-assets/releases/latest)
[](https://github.com/duhow/download-github-release-assets/actions?workflow=CI)
# GitHub Action: Download GitHub Release Assets
Inspired by [dsaltares/fetch-gh-release-asset](https://github.com/dsaltares/fetch-gh-release-asset) GitHub Action and several others,
this action downloads all assets from a Release, without needing to build a Docker container.
This results in a faster job execution, since GitHub Actions Runner will execute the JavaScript code directly. :)
## Example
```yaml
name: ci
on:
push:
branches:
- 'master'
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download release dependencies
uses: duhow/download-github-release-assets@v1
with:
token: ${{ secrets.PAT_TOKEN }}
repository: actions/runner
tag: v2.282.1
files: actions-runner-linux-x64-*.tar.gz
target: apps/actions-runner.tar.gz
- name: Extract
run: |
tar xzvf apps/actions-runner.tar.gz
```
## Inputs
### `token`
**Optional** GitHub Token to authenticate as. Defaults to `${{ secrets.GITHUB_TOKEN }}`
### `repository`
The `org/repo` containing the release. Defaults to the current repository.
### `release-id`
The Release ID version to fetch. If no `tag` is specified, defaults to `latest` release.
### `tag`
The Git tag name to fetch the release from.
### `files`
**Required** The name of the file/s to download as a list, or single file.
If `files` is set to `'*'`, **all assets** are downloaded.
You can use `*` wildcard to select a file pattern.
```yaml
files: |
config.json
program-*.exe
```
### `target`
Target file path. If several `files` are specified, this is the folder to download the files (recursive folders will be created if don't exist).
If `files` contains a single file, this is the full path to download the file (recursive folders will be created).
### `download`
Set to false if you do not want to download files, output assets still will contain selected files.
## Outputs
### `name`
The title / name of the selected release.
### `body`
The description / body of the selected release.
### `tag`
The Git tag value of the selected release. Useful to attempt knowing the version if you selected `latest`.
### `assets`
List of full path assets downloaded.