Skip to content

GitHub action for updating changelog and bumping the project version using git commit messages formatted according to Conventional Commits and Semantic Versioning.

License

Notifications You must be signed in to change notification settings

prantlf/bump-version-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update Changelog and Bump Version

GitHub action for updating changelog and bumping the project version using git commit messages formatted according to Conventional Commits and Semantic Versioning.

Uses tools newchanges and vp. Uses git to detect changed files. Only platforms Linux, macOS, Windows on the architecture X64 are supported.

Usage

Update the change log and write the new version ot the project source files:

- uses: prantlf/bump-version-action@v2

Work only in specific release branches, bump the version number in an extra file:

jobs:
  build:
    steps:
    - uses: actions/checkout@v4
    - uses: prantlf/setup-v-action@v2
    - run: ...
    - uses prantlf/bump-version-action@v2
      with:
        branches: master v1.x
        bump-files: src/newchanges.v

Attention: This action can be used only to update an already published project. The first publishing has to happen manually:

  1. Changelog with the first version has to be added, for example, a file CHANGELOG.md:
# Changes

# 1.0.0 (2023-10-22)

Initial release
  1. Commit releasing the first version has to be correspondingly tagged, for example with v1.0.0.

Then this action can be added to a GitHub workflow.

Inputs

The following parameters can be specified using the with object:

branches

Type: String
Default: 'main master'

Branches which this action should run for, which are used to publishing releases. Use whitespace for separating the branch names. If you want to use multiple lines in YAML, introduce them with ">-". If you want to allow all branches, set the value to "*".

no-node

Type: Boolean
Default: false

Set to true to ignore package.json and not handle the project as a Node.js package.

no-vlang

Type: Boolean
Default: false

Set to true not to ignore v.mod and not handle the project as a V package.

no-rust

Type: Boolean
Default: false

Set to true not to ignore Cargo.toml and not handle the project as a Rust package.

no-golang

Type: Boolean
Default: false

Set to true not to ignore go.mod and not handle the project as a Go package.

bump-files

Type: String

Extra files in which to bump the version number, in addition to the package description file.

enable

Type: Boolean
Default: true

Can be set to false to prevent this action from running. It's helpful in the pipeline, which will not continue releasing, but only building and testing, and that will be decided in the middle of a job execution.

dry-run

Type: Boolean
Default: false

Can be set to true to only print what would be done without actually doing it.

debug

Type: Boolean
Default: false

Can be set to true to enable debug logging of the supporting tools. Debug logging will be enabled also if it's enabled on the runner.

Outputs

The following parameters can be accessed by the github context:

bumped

Type: String

Set to true if the changelog was updated and the new version set.

new-version

Type: String

The new version written to the changelog and to the project source files.

changed-files

Type: String

Files modified by this action, separated by spaces.

License

Copyright (C) 2023-2024 Ferdinand Prantl

Licensed under the MIT License.

About

GitHub action for updating changelog and bumping the project version using git commit messages formatted according to Conventional Commits and Semantic Versioning.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages