Github Action to download an asset from a Github release
  • TypeScript 100%
Find a file
David Saltares aa2ab1243d
fix: 61 - upgrade to node 20 (#63)
* chore: ignore mac .DS_Store files

* fix: 61 - upgrade to node 20

* chore: add .nvmrc file to specify node version
2024-04-26 10:19:36 +03:00
.github/workflows fix: 50 - actually default version to latest (#56) 2023-04-20 17:08:21 +03:00
dist feat: support unauthenticated requests (#59) 2023-11-28 16:36:33 +02:00
.eslintrc.json core: add prettier 2022-05-06 20:55:37 +03:00
.gitignore fix: 61 - upgrade to node 20 (#63) 2024-04-26 10:19:36 +03:00
.nvmrc fix: 61 - upgrade to node 20 (#63) 2024-04-26 10:19:36 +03:00
.prettierignore core: add prettier 2022-05-06 20:55:37 +03:00
.prettierrc core: add prettier 2022-05-06 20:55:37 +03:00
action.yaml fix: 61 - upgrade to node 20 (#63) 2024-04-26 10:19:36 +03:00
index.ts feat: support unauthenticated requests (#59) 2023-11-28 16:36:33 +02:00
LICENSE Initial commit 2020-02-25 08:04:58 +02:00
package.json fix: set-output deprecating warning from GitHub (#51) 2022-10-29 07:33:18 +02:00
README.md chore: remove support notice 2023-07-06 12:20:04 +03:00
tsconfig.json feat: 37 - add support for Github Enterprise (#46) 2022-05-08 17:44:07 +03:00
yarn.lock Bump json5 from 1.0.1 to 1.0.2 (#55) 2023-04-20 17:15:13 +03:00

Fetch GH Release Asset

This action downloads an asset from a GitHub release and provides some release details as output. Private repos are supported.

Inputs

file

Required The name of the file to be downloaded.

repo

The org/repo containing the release. Defaults to the current repo.

token

The GitHub token. Defaults to ${{ secrets.GITHUB_TOKEN }}

version

The release version to fetch from in the form tags/<tag_name> or <release_id>. Defaults to latest.

target

Target file path. Only supports paths to subdirectories of the GitHub Actions workspace directory.

regex

Boolean indicating if file is to be interpreted as regular expression. Defaults to false.

octokitBaseUrl

The Github API base URL. Useful if you are using Github Enterprise.

Outputs

version

The version number of the release tag. Can be used to deploy for example to itch.io

name

Also called a title of a release. Defaults to the same value as version if not specified when creating a release.

body

The body (description) of a release.

Example usage

Save a single asset as a new file <workspace>/plague-linux.zip:

uses: dsaltares/fetch-gh-release-asset@master
with:
  repo: 'dsaltares/godot-wild-jam-18'
  version: 'tags/v0.1.18'
  file: 'plague-linux.zip'
  token: ${{ secrets.GITHUB_TOKEN }}

Save a single asset as a new file <workspace>/subdir/plague-linux.zip:

uses: dsaltares/fetch-gh-release-asset@master
with:
  repo: 'dsaltares/godot-wild-jam-18'
  version: 'tags/v0.1.18'
  file: 'plague-linux.zip'
  target: 'subdir/plague-linux.zip'
  token: ${{ secrets.GITHUB_TOKEN }}

Save a range of assets as new files in directory <workspace>:

uses: dsaltares/fetch-gh-release-asset@master
with:
  repo: 'dsaltares/godot-wild-jam-18'
  version: 'tags/v0.1.18'
  regex: true
  file: "plague-.*\\.zip"
  token: ${{ secrets.GITHUB_TOKEN }}

Save a range of assets as new files in directory <workspace>/subdir:

uses: dsaltares/fetch-gh-release-asset@master
with:
  repo: 'dsaltares/godot-wild-jam-18'
  version: 'tags/v0.1.18'
  regex: true
  file: "plague-.*\\.zip"
  target: 'subdir/'
  token: ${{ secrets.GITHUB_TOKEN }}