DEPRECATED IN FAVOR OF simbo/changes-between-tags-action
A GitHub action to collect all changes to a repository since the last release.
This action collects all git commit messages from a git repository since the last git tag and provides them as output list together with the last git tag.
To make the necessary information available, the repository needs to be checked out with tags and history.
(e.g. using actions/checkout
with fetch-depth: 0
)
Name | Description | Type | Default |
---|---|---|---|
line-prefix |
prefix to add to every collected commit message | String | "- " |
include-hashes |
whether or not the commit hashes should be included | Boolean | true |
Name | Description | Type |
---|---|---|
last-tag |
last tag from where on changes are collected | String |
log |
collected commit messages | String |
If the repository does not have any tags present, last-tag
will be null and log
will be all prior commit messages.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 📋 Get Commits since last Release
id: changes
uses: simbo/changes-since-last-release-action@v1
- name: 📣 Output collected Data
run: |
echo "Changes since ${{ steps.changes.outputs.last-tag }}:"
echo "${{ steps.changes.outputs.log }}"
Output:
Changes since 0.1.0:
- 7e6b5f6 bump version
- 4aeb444 another change
- a7d21d6 fix something
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 📋 Get Commits since last Release
id: changes
uses: simbo/changes-since-last-release-action@v1
with:
line-prefix: "* "
include-hashes: false
- name: 📣 Output collected Data
run: |
echo "Changes since ${{ steps.changes.outputs.last-tag }}:"
echo "${{ steps.changes.outputs.log }}"
Output:
Changes since 0.1.0:
* bump version
* another change
* fix something
A common usecase is to use this action's output together with the actions "Create a Release" and "Version Check":
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: 👀 Check for Version Update
id: version
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/my-awesome-package/package.json
static-checking: localIsNew
- name: 📋 Get Commits since last Release
if: steps.version.outputs.changed == 'true'
id: changes
uses: simbo/changes-since-last-release-action@v1
- name: 🎁 Create Tag and GitHub Release
if: steps.version.outputs.changed == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
Changes since ${{ steps.changes.outputs.last-tag }}:
${{ steps.changes.outputs.log }}