Github Release
ActionsTags
(2)Creates a plain Github release, without attaching assets or source code.
name: Publish Releaseon:
push:
tags:
- 'v*'jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v3
- name: Create a Releaseuses: elgohr/Github-Release-Action@v5env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:
title: MyReleaseMessagetitle is a message which should appear in the release. May contain spaces.
workdir can be used to specify a directory that contains the repository to be published.
with:
title: MyReleaseMessageworkdir: myDirectoryNametag can be used to set the tag of the release.
with:
title: MyReleaseMessagetag: MyTagprerelease is used to publish a prerelease.
with:
title: MyReleaseMessageprerelease: true${{ secrets.GITHUB_TOKEN }} can be used for publishing, if you configure the correct permissions.
This can be done by giving the Github token all permissions (referred to as "Read and write permission") with the setting below available in Settings > Actions > General
OR alternatively it can be achieved via adding
permissions:
packages: writecontents: writeto the concrete job creating the release. For more details see the documentation on token permissions.
To publish your release to self-hosted GitHub Enterprise, include GH_ENTERPRISE_TOKEN and GH_HOST as environment variables.
For example:
- name: Create Releaseif: ${{ github.event.inputs.create_release }}uses: elgohr/Github-Release-Action@v5env:
GH_ENTERPRISE_TOKEN: ${{ secrets.GITHUB_TOKEN }}GH_HOST: yourgithub.company.comwith:
title: "New release"tag: "v1.0.1"Github Release is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.