Home

Awesome

Release Action

This action will create a GitHub release and optionally upload an artifact to it.

<div align="center"> <strong> <samp>

English · 简体中文

</samp> </strong> </div>

Action Inputs

Input nameDescriptionRequiredDefault Value
allowUpdatesAn optional flag which indicates if we should update a release if it already exists. Defaults to false.false""
artifactErrorsFailBuildAn optional flag which indicates if artifact read or upload errors should fail the build.false""
artifactsAn optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs)false""
artifactContentTypeThe content type of the artifact. Defaults to rawfalse""
bodyAn optional body for the release. Note: This input will have white space trimmed before and after it. Use bodyFile if you need a non-trivial markdown body.false""
bodyFileAn optional body file for the release. This should be the path to the file.false""
commitAn optional commit reference. This will be used to create the tag if it does not exist.false""
discussionCategoryWhen provided this will generate a discussion of the specified category. The category must exist otherwise this will cause the action to fail. This isn't used with draft releases. The default "Announcements" category is not supported via the API and will cause an error if used here.false""
draftOptionally marks this release as a draft release. Set to true to enable.false""
generateReleaseNotesIndicates if release notes should be automatically generated.falsefalse
makeLatestIndicates if the release should be the "latest" release or not. legacy specifies that the latest release should be determined based on the release creation date and higher semantic version.false"legacy"
nameAn optional name for the release. If this is omitted the tag will be used.false""
omitBodyIndicates if the release body should be omitted.falsefalse
omitBodyDuringUpdateIndicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates.falsefalse
omitDraftDuringUpdateIndicates if the draft flag should be omitted during updates. The draft flag will still be applied for newly created releases. This will preserve the existing draft state during updates.falsefalse
omitNameIndicates if the release name should be omitted.falsefalse
omitNameDuringUpdateIndicates if the release name should be omitted during updates. The name will still be applied for newly created releases. This will preserve the existing name during updates.falsefalse
omitPrereleaseDuringUpdateIndicates if the prerelease flag should be omitted during updates. The prerelease flag will still be applied for newly created releases. This will preserve the existing prerelease state during updates.falsefalse
ownerOptionally specify the owner of the repo where the release should be generated. Defaults to current repo's owner.false"current repo owner"
prereleaseOptionally marks this release as prerelease. Set to true to enable.false""
removeArtifactsIndicates if existing release artifacts should be removed.falsefalse
replacesArtifactsIndicates if existing release artifacts should be replaced.falsetrue
repoOptionally specify the repo where the release should be generated.falsecurrent repo
skipIfReleaseExistsWhen skipIfReleaseExists is enabled the action will be skipped if a non-draft release already exists for the provided tag.falsefalse
tagAn optional tag for the release. If this is omitted the git ref will be used (if it is a tag).false""
tokenThe GitHub token. This will default to the GitHub app token. This is primarily useful if you want to use your personal token (for targeting other repos, etc). If you are using a personal access token it should have access to the repo scope.falsegithub.token
updateOnlyUnreleasedWhen allowUpdates is enabled, this will fail the action if the release it is updating is not a draft or a prerelease.falsefalse

Action Outputs

Output nameDescription
idThe identifier of the created release.
html_urlThe HTML URL of the release.
upload_urlThe URL for uploading assets to the release.

Example

This example will create a release when a tag is pushed:

name: Releases

on: 
  push:
    tags:
    - '*'

jobs:

  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
    - uses: actions/checkout@v3
    - uses: ncipollo/release-action@v1
      with:
        artifacts: "release.tar.gz,foo/*.txt"
        bodyFile: "body.md"

Notes