https://github.com/step-security/fetch-gh-release-asset
Github Action to download an asset from a Github release. Secure drop-in replacement for dsaltares/fetch-gh-release-asset.
https://github.com/step-security/fetch-gh-release-asset
step-security-maintained-actions
Last synced: 5 months ago
JSON representation
Github Action to download an asset from a Github release. Secure drop-in replacement for dsaltares/fetch-gh-release-asset.
- Host: GitHub
- URL: https://github.com/step-security/fetch-gh-release-asset
- Owner: step-security
- License: mit
- Created: 2025-12-29T14:41:45.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-31T04:20:58.000Z (6 months ago)
- Last Synced: 2026-01-01T18:50:03.923Z (5 months ago)
- Topics: step-security-maintained-actions
- Language: TypeScript
- Homepage: https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions
- Size: 536 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# 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/` or ``. 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](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository). 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 `/plague-linux.zip`:
```yaml
uses: step-security/fetch-gh-release-asset@v1
with:
repo: 'step-security/fetch-gh-release-asset'
version: 'tags/v0.1.18'
file: 'plague-linux.zip'
token: ${{ secrets.GITHUB_TOKEN }}
```
Save a single asset as a new file `/subdir/plague-linux.zip`:
```yaml
uses: step-security/fetch-gh-release-asset@v1
with:
repo: 'step-security/fetch-gh-release-asset'
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 ``:
```yaml
uses: step-security/fetch-gh-release-asset@v1
with:
repo: 'step-security/fetch-gh-release-asset'
version: 'tags/v0.1.18'
regex: true
file: "plague-.*\\.zip"
token: ${{ secrets.GITHUB_TOKEN }}
```
Save a range of assets as new files in directory `/subdir`:
```yaml
uses: step-security/fetch-gh-release-asset@v1
with:
repo: 'step-security/fetch-gh-release-asset'
version: 'tags/v0.1.18'
regex: true
file: "plague-.*\\.zip"
target: 'subdir/'
token: ${{ secrets.GITHUB_TOKEN }}
```