feat: update the example #1
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: Setup My Action Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get Tag Version | |
id: tag_version | |
run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Generate Full Changelog | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: --verbose | |
env: | |
OUTPUT: CHANGELOG.md | |
GITHUB_REPO: ${{ github.repository }} | |
- name: Commit Changelog | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
set +e | |
git switch main | |
git add CHANGELOG.md | |
git commit -m "chore(release-bot): prepare for release notes on ${CURRENT_TAG}" | |
git push | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate Latest Release Notes | |
id: latest_release_notes | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: --latest --strip all | |
env: | |
OUTPUT: CHANGELOG.txt | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: CHANGELOG.txt |