Skip to content
tag

GitHub Action

git-get-release-action

1.2.4 Latest version

git-get-release-action

tag

git-get-release-action

Get information about GitHub release

Installation

Copy and paste the following snippet into your .yml file.

              

- name: git-get-release-action

uses: cardinalby/git-get-release-action@1.2.4

Learn more about this action in cardinalby/git-get-release-action

Choose a version

integration-test functional-test build-pack

Get GitHub release information

Allows you to get a release information by release id, tag, commit SHA or get the last release.

If release not found, it finishes with an error.

Inputs

Search by:

Set exactly 1 input from the list to search release by:

๐Ÿ”ธ releaseId

Release id (number).

๐Ÿ”ธ tag

Tag name.

๐Ÿ”ธ commitSha

SHA of commit. Can be used to find a draft release.

๐Ÿ”ธ releaseName

Exact release name. Returns most recent found. Can be used to find a draft release.

๐Ÿ”ธ releaseNameRegEx

Regexp to test release name

๐Ÿ”ธ latest

Set 1 or true to get the latest non-draft release.

If no inputs specified, the action will try to get release for the current commit SHA.

Additional filters

With any of inputs above you can also use 2 additional filter inputs:

๐Ÿ”น draft

Set true to search only for draft releases.
Set false to search only releases that are not draft. Leave empty to not check if a release is a draft.

๐Ÿ”น prerelease

Set true to search only for prerelease releases.
Set false to search only releases that are not prerelease. Leave empty to not check if a release is a prerelease.

Options

๐Ÿ”ป doNotFailIfNotFound Optional, default: false

Set true to force the action to finish with success even if release was not found. Can be useful in composite actions, where continue-on-error is not available. If set, you can examine id output to know if release was found.

๐Ÿ”ป searchLimit Optional, default: 90

If you use one of commitSha, releaseName, releaseNameRegEx inputs you can also specify how many releases action should retrieve to perform a search. Specify more than 90 if you age going to search for old releases and less if you want to speed up the search.

๐Ÿ”ป repo Optional, default: current repository

Repository name in form of "owner/name". If not set, GITHUB_REPOSITORY env variable is used that by default points to a current repository.

Env variables

You should set GITHUB_TOKEN env variable to enable action to access GitHub API. For some operations default github.token is not enough, you need to pass a personal access token.

Outputs

Values from API response object:

  • html_url
  • upload_url can be used to upload assets
  • tarball_url
  • zipball_url
  • id
  • tag_name
  • target_commitish
  • name
  • body
  • draft contains true or false string value
  • prerelease contains true or false string value
  • created_at
  • published_at
  • url
  • assets_url
  • node_id
  • author (JSON with author object)
  • assets (JSON with assets object)

Usage example

- uses: cardinalby/git-get-release-action@v1
  env:
    GITHUB_TOKEN: ${{ github.token }}  # or your personal access token
  with:
    tag: '1.2.3'    
- uses: cardinalby/git-get-release-action@v1
  env:
    GITHUB_TOKEN: ${{ github.token }}  # or your personal access token
  with:
    commitSha: e92acb19de8845ad1f3cb6cfab421ac26002d6b6
    prerelease: false

For more examples check out functional self-test.