ghaction-github-pages/.github/workflows/uncommited.yml

38 lines
871 B
YAML
Raw Normal View History

2019-10-20 10:52:34 +08:00
name: uncommited
on:
pull_request:
push:
jobs:
changes:
runs-on: ubuntu-latest
steps:
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v1
2019-10-23 16:06:29 +08:00
-
# https://github.com/actions/setup-node
name: Set up Node
uses: actions/setup-node@v1
2019-10-20 10:52:34 +08:00
-
name: Build
run: |
npm install
npm run format
2019-11-15 06:25:05 +08:00
npm run build
-
name: Prune prod
run: |
rm -rf node_modules
npm install --production
2019-10-20 10:52:34 +08:00
-
name: Check for uncommitted changes
run: |
if [[ `git status --porcelain` ]]; then
2019-10-23 18:00:58 +08:00
git status --porcelain
2019-10-20 10:52:34 +08:00
echo "##[error] found changed files after build. please 'npm run build && npm run format && npm prune --production'"
2019-10-23 16:06:29 +08:00
exit 1
2019-10-20 10:52:34 +08:00
fi