mirror of
https://github.com/imjasonh/apidiff-action
synced 2026-07-06 22:52:43 +00:00
Remove automated build workflow, require local builds
- Remove build-dist.yml workflow - Update documentation to clarify local build requirement - Keep pre-commit hooks to ensure dist is always up to date This ensures developers build dist locally with the correct Node version before committing, which is checked by CI. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9f05344e16
commit
f2b49d3bf2
2 changed files with 13 additions and 60 deletions
52
.github/workflows/build-dist.yml
vendored
52
.github/workflows/build-dist.yml
vendored
|
|
@ -1,52 +0,0 @@
|
|||
name: Build dist
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'index.js'
|
||||
- 'lib/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build dist
|
||||
run: npm run build
|
||||
|
||||
- name: Check for changes
|
||||
id: check-changes
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain dist)" ]; then
|
||||
echo "changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit and push if changed
|
||||
if: steps.check-changes.outputs.changes == 'true'
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add dist/
|
||||
git commit -m "Build dist with Node 20
|
||||
|
||||
🤖 Automated build from workflow"
|
||||
git push
|
||||
21
CLAUDE.md
21
CLAUDE.md
|
|
@ -86,15 +86,20 @@ The action uses `@vercel/ncc` to compile all dependencies into a single `dist/in
|
|||
|
||||
**Important**: The dist must be built with Node.js v20 to match GitHub Actions runtime.
|
||||
|
||||
There are two ways to update dist/:
|
||||
To build and commit dist after making changes:
|
||||
|
||||
1. **Automatic (recommended)**: Push changes to main branch and the build-dist workflow will automatically rebuild with Node 20
|
||||
2. **Manual**: If you have Node 20 installed locally:
|
||||
```bash
|
||||
node --version # Must show v20.x.x
|
||||
npm run build
|
||||
git add dist/index.js
|
||||
```
|
||||
```bash
|
||||
# Ensure you're using Node v20 (use nvm if installed)
|
||||
nvm use # Reads .nvmrc and switches to Node 20.9.0
|
||||
node --version # Should show v20.x.x
|
||||
|
||||
# Build and commit
|
||||
npm run build
|
||||
git add dist/index.js
|
||||
git commit -m "Rebuild dist"
|
||||
```
|
||||
|
||||
The pre-commit hooks will ensure dist is up to date before allowing commits.
|
||||
|
||||
### Pre-commit Hooks
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue