v1.2.19 #10
Workflow file for this run
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
name: Generate Changelog | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
generate-changelog: | |
if: github.repository == 'alioth-center/infrastructure' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 获取完整的历史记录和所有标签 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Install git-chglog | |
run: go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest | |
- name: Debugging info | |
run: | | |
git fetch --tags | |
git tag | |
- name: Generate CHANGELOG | |
run: git-chglog -o changelog.md | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout main # 切换到 main 分支 | |
git add changelog.md | |
git commit -m "chore: update CHANGELOG" | |
git push origin main # 推送到 main 分支 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |