Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdv2429 committed May 2, 2024
1 parent 93199d6 commit 5b4a74f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Changelog Update

on:
push:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]

permissions: write-all

Expand All @@ -15,26 +16,28 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'npm'

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

- name: Generate changelog
- name: Generate changelog diff
run: |
git fetch --unshallow || git fetch origin main:main
echo "Pull Request Title: ${{ github.event.pull_request.title }}"
echo "Pull Request Body: ${{ github.event.pull_request.body }}"
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
cat CHANGELOG.md
git diff CHANGELOG.md > changelog_diff.md
cat changelog_diff.md
- 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" || echo "No changes to commit"
git push origin main
git commit -m "Update CHANGELOG.md based on PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
git push origin HEAD:refs/heads/${{ github.head_ref }}

0 comments on commit 5b4a74f

Please sign in to comment.