Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Action - Get Latest Release

A simple GitHub Action to get the latest release from another repository.

Configuration

Example Repository - https://github.com/ophiosdev/github-action-latest-release

Inputs

NameDescriptionRequiredDefaultExample
repositoryThe repository name in fullYesN/Aophiosdev/github-action-latest-release
includeDraftsWhether to include draft releases. Defaults to false.Nofalse"true"
includePreReleasesWhether to include prerelease versions. Defaults to false.Nofalse"true"
excludesRegular expression to match and exclude release tag names.No(empty)"^v0\.1"
includesRegular expression to match and include release tag names.No(empty)"^v1\."
fallbackToTagsFall back to the latest tag when no releases are foundNofalse"true"
tokenThe GitHub token or personal access tokenNo(empty)${{ secrets.GITHUB_TOKEN }}

When fallbackToTags is enabled, repositories that do not publish releases - for example anthropics/claude-code - fall back to the latest tag. In that case the description and assetsUrl outputs are empty and id is the tag's commit SHA.

Using the GITHUB_TOKEN will avoid the action failing due to hitting API rate limits from the IP address of the GitHub runner your action is running on. Using a PERSONAL_ACCESS_TOKEN is required to get the release information from a private repository. You can read about how to create a personal access token here and how to add this as a repository secret here.

Outputs

NameDescriptionExample
releaseThe latest release version tagv0.3.0
idThe latest release version id12345
descriptionThe latest release description bodyThis is an example release
urlAPI URL for the latest releasehttps://api.github.com/repos/owner/repo/releases/12345
assetsUrlAPI URL for release assetshttps://api.github.com/repos/owner/repo/releases/12345/assets

Usage Example

name: Build Docker Imageson: [push, repository_dispatch]jobs:
build:
name: RedisTimeSeriesruns-on: ubuntu-lateststeps:
- id: keydbuses: ophiosdev/github-action-latest-release@masterwith:
owner: JohnSullyrepo: KeyDBincludeDrafts: falseincludePreReleases: falseexcludes: "-beta$"includes: "^v.*"
- id: timeseriesuses: ophiosdev/github-action-latest-release@masterwith:
repository: RedisTimeSeries/RedisTimeSeriesincludeDrafts: trueincludePreReleases: false
- uses: actions/checkout@v3
- uses: docker/build-push-action@v3with:
username: ${{ secrets.DOCKER_USERNAME }}password: ${{ secrets.DOCKER_PASSWORD }}repository: ophiosdev/keydb-timeseriesdockerfile: timeseries.dockerfilebuild_args: KEY_DB_VERSION=${{ steps.keydb.outputs.release }},REDIS_TIME_SERIES_VERSION=${{ steps.timeseries.outputs.release }}tags: latest, ${{ steps.keydb.outputs.release }}_${{steps.timeseries.outputs.release }}

To use the current repository:

with:
repository: ${{ github.repository }}

To use authentication token:

with:
token: ${{ secrets.GITHUB_TOKEN }}

How to Rebase

The dist/ folder contains generated build artifacts. To prevent merge or rebase conflicts on those files, they are marked in .gitattributes with -diff and merge=ours. During a rebase or merge, dist/ changes are never conflicting and the version of the branch you are rebasing onto is kept automatically.

One-time setup on your machine is required for the merge=ours driver:

git config --global merge.ours.driver true

Without this configuration, Git falls back to a regular three-way merge and dist/ files can conflict again. The dist/ files of the branch you rebase onto are generated from its src/, so keeping them is always the correct choice.

About

A simple Github action to get the latest release from another repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages