Member-only story

GitHub Actions versioning with tag

Pietro Colombo
2 min readSep 13, 2024

--

Photo by EJ Strat on Unsplash

This guide uses GitHub Actions and commitizen to manage version progress and update the CHANGELOG.md file.

The idea is that when we do a commit on the main, or do a merge on the main, the pipeline will do the version advance and commit the tag, CHANGELOG.md and version files

First, You have to configure your repository Settings -> Action -> General -> Workflow permissions and choose read and write permissions

Image by author

This is the file configuration for the pipleline .github/workflows/bumpversion.yaml

name: Bump version

on:
push:
branches:
- main

jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version…

--

--

Pietro Colombo
Pietro Colombo

Written by Pietro Colombo

Robotics and Software engineering

Responses (1)