chore: add tailored CodeRabbit config #30
Workflow file for this run
This file contains hidden or 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: GitHub Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from tag | |
| id: version | |
| run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| PREV_TAG=$(git tag -l "v*" --sort=-version:refname | sed -n '2p') | |
| if [ -z "$PREV_TAG" ]; then | |
| PREV_TAG=$(git rev-list --max-parents=0 HEAD) | |
| fi | |
| { | |
| echo "## What's Changed" | |
| echo "" | |
| FEATURES=$(git log $PREV_TAG..$VERSION --pretty=format:"- %s" --grep="^feat" 2>/dev/null || true) | |
| if [ -n "$FEATURES" ]; then | |
| echo "### Features" | |
| echo "$FEATURES" | head -20 | |
| echo "" | |
| fi | |
| FIXES=$(git log $PREV_TAG..$VERSION --pretty=format:"- %s" --grep="^fix" 2>/dev/null || true) | |
| if [ -n "$FIXES" ]; then | |
| echo "### Bug Fixes" | |
| echo "$FIXES" | head -20 | |
| echo "" | |
| fi | |
| OTHERS=$(git log $PREV_TAG..$VERSION --pretty=format:"- %s" --invert-grep --grep="^feat" --invert-grep --grep="^fix" 2>/dev/null | head -10 || true) | |
| if [ -n "$OTHERS" ]; then | |
| echo "### Other Changes" | |
| echo "$OTHERS" | |
| echo "" | |
| fi | |
| echo "---" | |
| echo "" | |
| echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREV_TAG...$VERSION" | |
| } > changelog.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: changelog.md | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |