Skip to content

Update typo

Update typo #55

Workflow file for this run

name: Update Changelog
on:
push:
branches:
- master
jobs:
update-changelog:
runs-on: ubuntu-latest
env:
version:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get the current version
id: current-version
run: echo "version=$(python setup.py --version)" >> $GITHUB_ENV
- name: Check if the commit message matches the release pattern
run: |
if [[ $(git log -1 --pretty=%B) != "Update changelog for v${{ env.version }}" ]]; then
echo "Commit message does not match the release pattern."
exit 1
fi
- name: Update changelog
if: contains(github.event.head_commit.message, 'Update changelog for v${{ env.version }}')
run: |
PREVIOUS_VERSION=$(git tag -l --sort=-creatordate | head -n 1)
CHANGES=$(git log --pretty=format:"- %s (%h)" $PREVIOUS_VERSION..)
echo "# v${{ env.version }}" >> CHANGELOG.md
echo "## Changes" >> CHANGELOG.md
echo "$CHANGES" >> CHANGELOG.md
git config user.email "[email protected]"
git config user.name "Md. Musfiqur Rahaman"
git commit -am "Update CHANGELOG.md with latest version by GitHub Action"
git push