Test Workflow #209
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check that module was built | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm i | |
- name: Install dependencies | |
run: git status | |
- name: Build the dist/ directory | |
run: npm run build | |
- name: Check for diff | |
run: | | |
git status | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "there are changes"; | |
exit 1 | |
else | |
echo "no changes"; | |
fi | |
git diff -w --exit-code dist/ | |
exit_code=$? | |
echo "Exit code: $exit_code" # Display the exit code | |
if [ $exit_code -ne 0 ]; then | |
echo $? | |
echo "Detected uncommitted changes after building. Please run 'npm run build' and commit the changes." | |
exit 1 | |
fi |