Creates a GitHub release using a workflow action.
name: Publish Release
on:
push:
branches:
- master
tags:
- "v*"
jobs:
release:
name: Publish Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create release
uses: action-pack/github-release@v2
with:
tag: MyReleaseTag
title: MyReleaseTitle
body: MyReleaseMessageIf a release with the same tag already exists, it will be deleted first and recreated.
When no body input is provided, the action automatically generates release notes.
The created release is marked as the latest release by default. Set latest to false to disable this.
The tag input is optional. When provided, it is used as the tag name for the release.
The commit input is optional. It can be a commit hash or branch name to attach the release to.
-
This can happen when the workflow does not have permission to create or update releases.
Add the following permissions to your workflow job:
permissions: contents: write
Alternatively, enable read and write workflow permissions in your repository settings under:
Settings -> Actions -> General -> Workflow permissions