Skip to content

Commit

Permalink
Update changelog.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
MusfiqDehan committed Oct 22, 2023
1 parent d20adb6 commit 0eedbe6
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,8 @@ jobs:
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 "musfiqur.rahaman@northsouth.edu"
git config user.name "Md. Musfiqur Rahaman"
git commit -am "Update CHANGELOG.md with latest version by GitHub Action"
git push
- name: Auto Update CHANGELOG
uses: MusfiqDehan/Auto-Update-CHANGELOG@v0.10.0
with:
email: "musfiqur.rahaman@northsouth.edu"
name: "Md. Musfiqur Rahaman"

0 comments on commit 0eedbe6

Please sign in to comment.