mirror of
https://github.com/actions/create-release.git
synced 2025-06-14 21:07:43 +00:00

Fixes #4 This adds the ability to include the body parameter when creating the release. - name: Checkout code uses: actions/checkout@master - name: Create Release id: create_release uses: actions/create-release@master with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} body: Release body This also supports a multiline body: - name: Create Release id: create_release uses: actions/create-release@master with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} body: | This is a multiline body with more than one line Or if you want the contents of a file: - name: Read CHANGELOG id: changelog run: | echo "::set-output name=body::$(cat CHANGELOG.md)" - name: Create Release id: create_release uses: actions/create-release@master with: release_name: Release ${{ github.ref }} body: ${{ steps.changelog.outputs.body }} One decision I made in favor of less code was to send an empty body when there was non present. If it would be preferred to send nothing in the request for the `body` attribute I could instead compose the parameters with an optional body attribute: releaseParams = { owner, repo, tag_name: tag, name: releaseName, draft, prerelease }; if (body) releaseParams.body = body; const createReleaseResponse = await github.repos.createRelease( releaseParams );
35 lines
1.1 KiB
YAML
35 lines
1.1 KiB
YAML
name: 'Create a Release'
|
|
description: 'Create a release on your repository'
|
|
author: 'GitHub'
|
|
inputs:
|
|
tag_name:
|
|
description: 'The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag'
|
|
required: true
|
|
release_name:
|
|
description: 'The name of the release. For example, `Release v1.0.1`'
|
|
required: true
|
|
body:
|
|
description: 'Text describing the contents of the tag.'
|
|
required: false
|
|
draft:
|
|
description: '`true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`'
|
|
required: false
|
|
default: false
|
|
prerelease:
|
|
description: '`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`'
|
|
required: false
|
|
default: false
|
|
outputs:
|
|
id:
|
|
description: 'The ID of the created Release'
|
|
html_url:
|
|
description: 'The URL users can navigate to in order to view the release'
|
|
upload_url:
|
|
description: 'The URL for uploading assets to the release'
|
|
runs:
|
|
using: 'node12'
|
|
main: 'dist/index.js'
|
|
branding:
|
|
icon: 'tag'
|
|
color: 'gray-dark'
|