Skip to content

Enterwell/ChangelogManager-GitHub-Action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

Changelog Manager GitHub Action

Compiles the change files into CHANGELOG.md

Test CodeQL GitHub issues

🌱 Introduction

This is the GitHub Action version of an Azure DevOps task developed for the convenience of managing a changelog, indirectly, using special change files.

What are the change files?

Change files are just files located in the changes directory with the following naming scheme:

<change_type> [<change_category>] <change_description>

Acceptable entries for the <change_type> are:

  • Added
  • Changed
  • Deprecated
  • Removed
  • Fixed
  • Security

This decision was inspired by following the principles for keeping a good changelog.

To avoid incorrect file naming and to ease this file creation process on the developer, Visual Studio extension and the CLI helper were made.

This Action internally calls our Changelog Manager tool by forwarding action inputs to it, which then inserts the appropriate section to the CHANGELOG.md and deletes all the contents of the changes directory.

We highly recommend that you read up on how and what exactly is it doing behind the scenes, as well as, learn how to use the .changelog.json configuration file to customize the tool's behaviour.

πŸ“– Table of contents

πŸ›  Prerequisities

The following prerequisities need to be fulfilled in order for the action to work properly:

Changes directory

Automation agent where the action executes needs to have a changes directory containing the change files created manually or with one of our helpers. If the directory does not exist, action will throw an error.

Changelog file

The action also needs to be able to find CHANGELOG.md file (naming is case-insensitive), otherwise, it will throw and stop executing.

Important note. As it currently stands, the action is inserting the newly compiled section above the latest changelog entry. So, the CHANGELOG.md needs to contain atleast

_NOTE: This is an automatically generated file. Do not modify contents of this file manually._

## [Unreleased]

πŸ“ Usage

Basic

uses: Enterwell/ChangelogManager-GitHub-Action@v3

Advanced

uses: Enterwell/ChangelogManager-GitHub-Action@v3
with:
  changelog-location: ./
  changes-in-different-location: true
  changes-location: ./somewhere-else/changes
  should-bump-version: true
  path-to-project-file: ./somewhere-else/[package.json | something.csproj]

πŸ“₯ Inputs

changelog-location

Optional Location of the directory containing the CHANGELOG.md file.

  • Defaults to ./

changes-in-different-location

Optional Boolean representing that the changes directory exists in a different location than the CHANGELOG.md file.

  • Defaults to false

changes-location

Optional Location of the changes directory.

  • If the previous input is set to false, changes location is set to <location containing the CHANGELOG.md>\changes.

should-bump-version

Optional Boolean representing should the new version be set in the appropriate project file (package.json or *.csproj).

  • Defaults to false

path-to-project-file

Optional Path to the project file (package.json or .csproj with the version (case-insensitive) tag).

  • If the previous input is set to true, but this input is not passed in explicitly, the action will try to automatically determine the appropriate project file
  • If the previous input is set to false, this input is ignored

πŸ“€ Outputs

bumped-semantic-version

Newly bumped semantic version based on the changes made.

bumped-major-part

Major part of the newly bumped version

bumped-minor-part

Minor part of the newly bumped version

bumped-patch-part

Patch part of the newly bumped version

new-changes

Changes from the new changelog section

Usage

# github-workflow.yml
...
  steps:
    ...
    - uses: Enterwell/ChangelogManager-GitHub-Action@v3
      id: merge-changelog

    - run: echo ${{ steps.merge-changelog.outputs.bumped-semantic-version }}
    ...
...

πŸ— Development

This action uses pnpm as its package manager, so in order to get quickly up and developing you will need to have it installed on your machine.

If you don't already have it, you can easily install it by using the following command (assuming you have Node.js installed)

npm install --global pnpm

Now you can install dependencies using the following command

pnpm install

Available commands

Command Description
pnpm build Compile the TypeScript source code into JavaScript
pnpm lint Lint the source code
pnpm test Test the action
pnpm package Packages the action source code and its dependencies into dist folder

☎ Support

If you are having problems, please let us know by raising a new issue.

πŸͺͺ License

This project is licensed with the MIT License.