Skip to content

v1.4.3

v1.4.3 #38

name: "Update Changelog"
on:
release:
types: [released]
workflow_call:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Fetch entire history of repository to ensure relase date can be
# extracted from commit of the given tag.
fetch-depth: 0
# Checkout target branch of this release. Ensures that the CHANGELOG
# is not out of date.
ref: ${{ github.event.release.target_commitish }}
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Extract release date from git tag
id: release_date
run: |
echo "::set-output name=date::$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')"
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
# Pass extracted release date, release notes and version to the Action.
release-date: ${{ steps.release_date.outputs.date }}
release-notes: ${{ github.event.release.body }}
latest-version: ${{ github.event.release.tag_name }}
compare-url-target-revision: ${{ github.event.release.target_commitish }}
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
# Push updated CHANGELOG to release target branch.
branch: ${{ github.event.release.target_commitish }}
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
commit_user_name: Samuel Mwangi
commit_user_email: samuel@samuelmwangi.co.ke
commit_author: Samuel Mwangi <samuel@samuelmwangi.co.ke>