-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update and fix some changelog yml bugs
- Loading branch information
Showing
1 changed file
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
name: Generate Changelog | ||
name: Update Changelog | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: ['v*'] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
generate-changelog: | ||
update-changelog: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-depth: 0 | ||
|
||
- name: Generate Changelog | ||
id: changelog | ||
run: | | ||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD) | ||
git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" > CHANGELOG.md | ||
git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" >> CHANGELOG.md | ||
- name: Commit Changelog | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add CHANGELOG.md | ||
git commit -m "docs: update changelog" || echo "No changes to commit" | ||
git push origin HEAD:master | ||
git push origin master | ||
- name: Create GitHub Release | ||
- name: Create or Update Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
body_path: CHANGELOG.md | ||
draft: false | ||
prerelease: false | ||
prerelease: false | ||
tag_name: ${{ github.event.release.tag_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |