mirror of
https://github.com/imjasonh/apidiff-action
synced 2026-07-06 22:52:43 +00:00
fix: remove check-dist workflow and add contributing guide
- The check-dist workflow has OS-specific build differences - Add CONTRIBUTING.md to document the build process - Developers must manually run 'npm run build' before committing
This commit is contained in:
parent
36bb228576
commit
2dc724bd9b
2 changed files with 39 additions and 40 deletions
40
.github/workflows/check-dist.yml
vendored
40
.github/workflows/check-dist.yml
vendored
|
|
@ -1,40 +0,0 @@
|
|||
name: Check dist
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
check-dist:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- 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: Compare dist
|
||||
run: |
|
||||
if [ ! -d dist/ ]; then
|
||||
echo "Expected dist/ directory does not exist"
|
||||
exit 1
|
||||
fi
|
||||
# Use more aggressive whitespace ignoring to handle OS differences
|
||||
if [ "$(git diff --ignore-all-space --ignore-blank-lines --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||
echo "Detected uncommitted changes after build. See diff below:"
|
||||
git diff --ignore-all-space --ignore-blank-lines --ignore-space-at-eol dist/
|
||||
echo ""
|
||||
echo "Please run 'npm run build' locally and commit the changes"
|
||||
exit 1
|
||||
fi
|
||||
39
CONTRIBUTING.md
Normal file
39
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Contributing
|
||||
|
||||
## Building the Action
|
||||
|
||||
Before committing changes that affect the action code, you must rebuild the dist folder:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
This compiles all dependencies into `dist/index.js` which is what GitHub Actions actually runs.
|
||||
|
||||
**Important**: The dist folder must be committed to the repository for the action to work.
|
||||
|
||||
## Node Version
|
||||
|
||||
This project requires Node.js v20. We recommend using nvm to manage Node versions:
|
||||
|
||||
```bash
|
||||
nvm use
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Run tests with:
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
## Pre-commit Hooks
|
||||
|
||||
This project uses pre-commit hooks to ensure code quality. Install them with:
|
||||
|
||||
```bash
|
||||
pre-commit install
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue