chore: add code formatting config and pre-commit hooks (#450)

This commit is contained in:
manjaroblack
2025-08-16 19:08:39 -05:00
committed by GitHub
parent 51284d6ecf
commit ed539432fb
130 changed files with 11886 additions and 10939 deletions

View File

@@ -1,5 +1,5 @@
name: Release
'on':
"on":
push:
branches:
- main
@@ -22,7 +22,7 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
if: '!contains(github.event.head_commit.message, ''[skip ci]'')'
if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -32,9 +32,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
registry-url: https://registry.npmjs.org
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Run tests and validation
@@ -57,3 +57,17 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release
- name: Clean changelog formatting
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Remove any Claude Code attribution from changelog
sed -i '/🤖 Generated with \[Claude Code\]/,+2d' CHANGELOG.md || true
# Format and commit if changes exist
npm run format
if ! git diff --quiet CHANGELOG.md; then
git add CHANGELOG.md
git commit -m "chore: clean changelog formatting [skip ci]"
git push
fi