- Notifications
You must be signed in to change notification settings - Fork0
📦 GitHub Action for creating changelog based GitHub Releases
License
brainelectronics/changelog-based-release
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
GitHub Action for creating changelog based GitHub Releases
As this Action uses thechangelog2versionto parse and extract informations from a changelog, the requirements for thechangelog format have to meet certain criterias.
The header of an entry in the changelog has to follow the following format ifnot specified differently with theversion-line-regex
and/orsemver-line-regex
option in the workflow.
This changelog entry shall follow thesemantic version pattern and shall match the followingpattern:
## [x.y.z] - yyyy-mm-dd
or## [x.y.z] - yyyy-mm-ddThh:mm:ss
The line shall start with two hashtags (##
) followed by a single space ().The semver version with
x
,y
andz
as non-negative integers, seperatedby a dot (.
) and surrounded by square brackets ([]
). Followed by a space(), a dash (
-
), another space () and theISO8601 formatteddate. Additional timestamps after the date, seperated from the date by asingle space (
) or a capital (
T
), are optional. The semantic version taginside the square brackets ([]
) supports the full semantic versioning scope.
Examples:
## [1.2.3] - 2022-11-13
## [1.2.3-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay] - 2022-11-13T12:34:56
Thechangelog of this repo is an example of how the changelogshall look like to be parsable with the default changelog2version settings.
With the default values used a GitHub release and tag based on the changeloglocated in the project root will be created. For further details check thecustomizing section
Seeaction.yml
name:Create releaseon:push:branches: -mainpermissions:contents:writejobs:release:runs-on:ubuntu-latestname:Releasesteps: -name:Checkoutuses:actions/checkout@v3 -name:'Create changelog based release'uses:brainelectronics/changelog-based-release@v1
The following are optional asstep.with
keys
Name | Type | Description |
---|---|---|
github-token | String | Secret GitHub Personal Access Token. Defaults to${{ github.token }} |
changelog-path | String | Path to changelog used for releasing. Default tochangelog.md |
tag-name-prefix | String | Prefix of tag name before extraced x.y.z from changelog, e.g.v to getv1.2.3 |
tag-name-extension | String | Extension of tag name after extracted x.y.z from changelog, e.g.${{ github.sha }} to get1.2.3${{ github.sha }} . Defaults to-rc${{ github.run_number }}.dev${{ github.event.number }} e.g.1.2.3-rc21.dev |
release-name-prefix | String | Prefix of release name before extracted x.y.z from changelog, e.g.Release of to getRelease of 1.2.3 |
release-name-extension | String | Extension of release name after extracted x.y.z from changelog, e.g.-rc to get1.2.3-rc . Defaults to-rc${{ github.run_number }}.dev${{ github.event.number }} e.g.1.2.3-rc21.dev |
draft-release | Boolean | Indicator of whether or not this release is a draft. Defaults tofalse |
prerelease | Boolean | Indicator of whether or not is a prerelease. Defaults tofalse |
steps: -name:Checkoutuses:actions/checkout@v3 -name:'Create changelog based release'uses:brainelectronics/changelog-based-release@v1with:# note you'll typically need to create a personal access token# with permissions to create releases in the other repo# or you set the "contents" permissions to "write" as in this examplegithub-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}changelog-path:path/to/changelog.mdtag-name-prefix:'v'tag-name-extension:'+${{ github.sha }}'release-name-prefix:'Release of'release-name-extension:'-rc'draft-release:trueprerelease:true
The Action provides the following output variables
Name | Type | Description |
---|---|---|
latest-description | String | Content of latest changelog entry |
latest-version | String | Latest changelog version |
steps: -name:Checkoutuses:actions/checkout@v3 -name:'Create changelog based release'uses:brainelectronics/changelog-based-release@v1id:changelog-release -name:Report action outputrun:| echo "Latest changelog change description: ${{ steps.changelog-release.outputs.latest-description }}" echo "Latest changelog version: ${{ steps.changelog-release.outputs.latest-version }}"
This Action requires the following permissions on the GitHub integration token:
permissions:contents:write
GitHub token permissionscan be set for an individual job, workflow, or for Actions as a whole.
The scripts and documentation in this project are released under theMIT License
About
📦 GitHub Action for creating changelog based GitHub Releases
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.