A GitHub action to collect all changes between two git tags and provides them for further usage in a release description, a changelog entry or something similar.
This action collects all git commit messages between two git tags and provides them for further usage.
It uses the repository in the current working directory and fetches all tags from the origin remote.
A regex pattern tag-pattern
can be defined to filter tags. Matching tags will
be sorted and the latest two tags are taken for comparison.
The action will fail if no matching tags are found.
If only one matching tag is found, the changes from the initial commit to this tag will be collected.
The action is meant to be run on a
push:tags
event.
Name | Description | Required | Default |
---|---|---|---|
tag-pattern |
the regex pattern to filter tags | No | '^v?[0-9]+\.[0-9]+\.[0-9]+$' |
validate-tag |
whether to check if the determined latest tag is the same tag that triggered the workflow | No | 'true' |
include-tag-commit |
whether to include the commit with the current tag | No | 'true' |
include-hashes |
whether or not each commit message should be prefixed with the corresponding hash | No | 'true' |
line-prefix |
the prefix to add to every listed commit | No | '- ' |
Name | Description |
---|---|
changes |
collected changes as multiline string |
tag |
the current/latest tag that was used for comparison |
ref |
the git reference that the tag was compared with |
on:
push:
tags:
- v*
jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
with:
# you need full history to collect changes correctly
fetch-depth: 0
- name: 📋 Get Changes between Tags
id: changes
uses: simbo/changes-between-tags-action@v1
- name: 📣 Output Data
run: |
echo "tag: ${{ steps.changes.outputs.tag }}"
echo "changes: ${{ steps.changes.outputs.changes }}"