Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
octagon

GitHub Action

Changeset Release

v1

Changeset Release

octagon

Changeset Release

A Github action for creating non-public releases with changesets

Installation

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

              

- name: Changeset Release

uses: 108yen/changeset-release@v1

Learn more about this action in 108yen/changeset-release

Choose a version

108yen/changeset-release

This action extracts the process of creating a release to github from Changesets Release Action. This allows for release whenever you want.

Usage

Inputs

  • format: Release tag format. Choose one of these. (Default: prefix.)
  • target: Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. (Default: the repository's default branch.)

Outputs

  • tag: Release tag. (Example: v1.0.0)

Example workflow

This is an example of a release workflow that works when a PR issued by Changesets Release Action is merged. The Changesets Release Action must be configured to work in a separate workflow.

name: Release

on:
  pull_request_target:
    types:
      - closed
    branches:
      - main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
  release:
    name: release

    permissions:
      contents: write

    if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'changeset-release/main')
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Release
        run: 108yen/changeset-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example of using output

name: Release

on:
  pull_request_target:
    types:
      - closed
    branches:
      - main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
  release:
    name: release

    permissions:
      contents: write

    if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'changeset-release/main')
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Release
        id: release
        run: 108yen/changeset-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Display Tag
        run: echo '${{ steps.release.outputs.tag }}'