Skip to content
arrow-down

GitHub Action

releases-action

v5 Latest version

releases-action

arrow-down

releases-action

Create a new release

Installation

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

              

- name: releases-action

uses: nickatnight/releases-action@v5

Learn more about this action in nickatnight/releases-action

Choose a version

GitHub Actions status Release Status

releases-action

A GitHub action to create a release from branch when pushing a new tag.

Other notable packages that did not satisfy my use case:

Usage 1

name: Tag it with defaults

on:
  push:
    tags:
      - "*"

jobs:
  create-release:
    permissions:
      contents: write
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0  # need this for all history for all branches and tags
      - name: Create Release
        id: create_release
        uses: nickatnight/releases-action@v5
        if: startsWith(github.ref, 'refs/tags/')
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    outputs:
      ReleaseTag: ${{ steps.create_release.outputs.release_tag }}

  # pass in as env variable
  explore-essos:
    runs-on: ubuntu-latest
    needs: [create-release]
    env:
      RELEASE_TAG: ${{ needs.create-release.outputs.ReleaseTag }}
    steps:
      ...

Usage 2

name: Tag it with parameters

on:
  push:
    tags:
      - "*"

jobs:
  create-release:
    permissions:
      contents: write
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Create Release
        id: create_release
        uses: nickatnight/releases-action@v5
        if: startsWith(github.ref, 'refs/tags/')
        with:
          branch: "main"
          name: "Gryffindor Release"
          message: "Yer a wizard Harry"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    outputs:
      ReleaseTag: ${{ steps.create_release.outputs.release_tag }}

  # pass in as env variable
  conquer-muggles:
    runs-on: ubuntu-latest
    needs: [create-release]
    env:
      RELEASE_TAG: ${{ needs.create-release.outputs.ReleaseTag }}
    steps:
      ...

Supported Parameters

Parameter Description Default
branch Which branch do we want to release from? master
name Name of the release name of tag
message Body of the release autogenerated
draft Is this a draft? false
prerelease Is this a prerelease? false
tag Name of tag GITHUB_REF