Skip to content

superfaceai/release-changelog-action

Repository files navigation

Keep a Changelog release

Use this Github action to release unreleased changes in your changelog. Keep a Changelog format is supported.

Operation release changelog

  • Unreleased section is released as new version
  • Compare links are updated
  • Empty unreleased section is created
  • Updated changelog is returned

Operation read version changelog

  • Returns changelog of concrete version

Release changelog example

name: Release software
on:
  ...

jobs:
  release:
    steps:
      - uses: actions/checkout@v2
      - name: Update changelog
        uses: superfaceai/release-changelog-action@v2
        with:
          path-to-changelog: CHANGELOG.md  # optional, default value is `CHANGELOG.md`
          version: 1.0.0
          operation: release
          format: markdownlint # optional, valid values are `compact` (default) or `markdownlint`

Read version changelog example

  name: Get version changelog
  on:
    ...

  jobs:
    get-changelog:
      steps:
        - uses: actions/checkout@v2
        - name: Get changelog
          id: get-changelog
          uses: superfaceai/release-changelog-action@v2
          with:
            path-to-changelog: CHANGELOG.md
            version: 1.0.0
            operation: read
        - name: Log changelog
          run: echo ${{ steps.get-changelog.outputs.changelog }}

Development

Install the dependencies

$ yarn install

Run tests

$ yarn test

Build and package it for distribution

$ yarn build && yarn package

Publish action to a distribution

Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run ncc and push the results:

$ npm run package
$ git add dist
$ git commit -a -m "chore: prod dependencies"

After testing make the new release available to those binding to the major version tag: Move the major version tag (v1, v2, etc.) to point to the ref of the current release.

$ git tag -fa v3 -m "Update v3 tag"
$ git push origin v3 --force