Skip to content

Commit

Permalink
Feat(ci): Auto changelog (#831)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
hoangdv2429 and github-actions authored May 9, 2024
1 parent 80b0324 commit 426015b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,32 @@ jobs:

- name: Generate Changelog Update
run: |
# Example: Using conventional-changelog to update CHANGELOG.md
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s
- name: Check if "auto-changelog-update" branch exists and update if needed
id: check_branch
run: |
git fetch origin auto-changelog-update:auto-changelog-update --no-tags
if git rev-parse --verify --quiet auto-changelog-update; then
echo "::set-output name=branch_exists::true"
git checkout auto-changelog-update
git merge main --no-edit
else
echo "::set-output name=branch_exists::false"
git checkout -b auto-changelog-update
fi
- name: Create or Update Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: "Update CHANGELOG.md [skip ci]"
title: "Automated Changelog Update [skip ci]"
body: "Update the CHANGELOG.md with recent pushs. [skip ci]"
branch: auto-changelog-update-${{ github.run_number }}
title: "Automated Changelog Update"
body: "Update the CHANGELOG.md with recent pushes to branch main."
branch: "auto-changelog-update" # Static branch name
delete-branch: true
branch-suffix: timestamp

branch-suffix: none
- name: Check if PR needs to be updated
if: steps.cpr.outputs.pull-request-operation == 'updated'
run: |
Expand Down

0 comments on commit 426015b

Please sign in to comment.