Skip to content

Commit

Permalink
guess I don't have a choice
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdv2429 committed May 2, 2024
1 parent 3164576 commit 8ba7c48
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,28 @@ jobs:
with:
node-version: "18"

- name: Update Changelog
- name: Install conventional-changelog-cli
run: npm install -g conventional-changelog-cli

- name: Simulate commit for PR title
run: |
# Format PR title as a conventional commit message
echo "${{ github.event.pull_request.title }}" > temp_message.txt
# Temporarily commit this message
git commit --allow-empty -F temp_message.txt
- name: Generate changelog
run: |
echo "### PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}" >> CHANGELOG.md
echo "" >> CHANGELOG.md
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
cat CHANGELOG.md
- name: Revert temporary commit
run: git reset HEAD~

- name: Commit and push changelog update
run: |
git config user.name 'github-actions'
git config user.email '[email protected]'
git add CHANGELOG.md
git commit -m "Update CHANGELOG.md with PR #${{ github.event.pull_request.number }} title"
git commit -m "Update CHANGELOG.md based on PR #${{ github.event.pull_request.number }} title"
git push origin HEAD:refs/heads/${{ github.head_ref }}

0 comments on commit 8ba7c48

Please sign in to comment.