Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(ci): Auto changelog #831

Merged
merged 15 commits into from
May 9, 2024
Merged
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