https://github.com/elgohr/github-release-action
Publish Github releases in an action
https://github.com/elgohr/github-release-action
action github publish publishing release
Last synced: 13 days ago
JSON representation
Publish Github releases in an action
- Host: GitHub
- URL: https://github.com/elgohr/github-release-action
- Owner: elgohr
- License: mit
- Created: 2019-03-31T16:05:26.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-02-05T03:30:47.000Z (3 months ago)
- Last Synced: 2025-04-08T14:09:26.842Z (13 days ago)
- Topics: action, github, publish, publishing, release
- Language: Shell
- Homepage:
- Size: 126 KB
- Stars: 198
- Watchers: 12
- Forks: 57
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github-Release-Action
[](https://github.com/elgohr/Github-Release-Action/actions)
Creates a plain Github release, without attaching assets or source code.
## Usage
```yaml
name: Publish Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: MyReleaseMessage
```## Mandatory Arguments
### title
`title` is a message which should appear in the release. May contain spaces.## Optional Arguments
### workdir
`workdir` can be used to specify a directory that contains the repository to be published.```yaml
with:
title: MyReleaseMessage
workdir: myDirectoryName
```### tag
`tag` can be used to set the tag of the release.```yaml
with:
title: MyReleaseMessage
tag: MyTag
```### prerelease
`prerelease` is used to publish a prerelease.```yaml
with:
title: MyReleaseMessage
prerelease: true
```## Notes
`${{ 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```yaml
permissions:
packages: write
contents: write
```to the concrete job creating the release. For more details see the [documentation on token permissions.](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token)
### GitHub Enterprise
To publish your release to self-hosted GitHub Enterprise, include `GH_ENTERPRISE_TOKEN` and `GH_HOST` as environment variables.
For example:```yaml
- name: Create Release
if: ${{ github.event.inputs.create_release }}
uses: elgohr/Github-Release-Action@v5
env:
GH_ENTERPRISE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_HOST: yourgithub.company.com
with:
title: "New release"
tag: "v1.0.1"
```