Skip to content

Instantly share code, notes, and snippets.

@elusive
Created August 30, 2023 14:05
Show Gist options
  • Save elusive/e21a8fe085f1aa9782d4860f3bc3513f to your computer and use it in GitHub Desktop.
Save elusive/e21a8fe085f1aa9782d4860f3bc3513f to your computer and use it in GitHub Desktop.
Github Actions workflow to create a release when any tag is pushed to main.
name: Create release
on:
push:
tags:
- v*
jobs:
release:
name: Release pushed tag
runs-on: ubuntu-22.04
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment