-
Notifications
You must be signed in to change notification settings - Fork 66
39 lines (33 loc) · 1.08 KB
/
changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Update Changelog
on:
release:
types: [published]
jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
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
- 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 master
- name: Create or Update Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
draft: false
prerelease: false
tag_name: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}