mirror of
https://github.com/pacnpal/Claude-code-review.git
synced 2025-12-19 20:01:05 -05:00
- Use git diff --staged --quiet to only commit if there are changes - Make push fail gracefully to allow release creation to continue - Resolves issue where workflow fails when dist/index.js hasn't changed
42 lines
1019 B
YAML
42 lines
1019 B
YAML
# .github/workflows/release.yml
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Commit built files
|
|
run: |
|
|
git config --global user.name 'claude-code-review[bot]'
|
|
git config --global user.email 'claude-code-review[bot]@users.noreply.github.com'
|
|
git add -f dist
|
|
git diff --staged --quiet || git commit -m 'Add built files'
|
|
git push origin HEAD:main || echo "No changes to push or push failed"
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: dist/*
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|