mirror of
https://github.com/imjasonh/apidiff-action
synced 2026-07-06 22:52:43 +00:00
- Remove pre-commit hooks for building/checking dist - Add check-dist.yml workflow that validates dist in CI - This matches the approach used by actions/javascript-action - Eliminates OS-specific build differences affecting commits
39 lines
912 B
YAML
39 lines
912 B
YAML
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
|
|
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
|
|
echo "Detected uncommitted changes after build. See diff below:"
|
|
git diff --ignore-space-at-eol --text dist/
|
|
echo ""
|
|
echo "Please run 'npm run build' locally and commit the changes"
|
|
exit 1
|
|
fi
|