Skip to content

Commit

Permalink
Create PR check for uncommitted transpiled code (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-kebets-sonarsource committed Mar 17, 2023
1 parent 3c1d046 commit 4387564
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
container:
image: node:latest

apply_changes_and_check_task:
apply_changes_and_check_script:
- npm run build
# the check-committed.sh script should always be executed last
- ./scripts/check-committed.sh

13 changes: 13 additions & 0 deletions scripts/check-committed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/sh

# Inspired by https://stackoverflow.com/a/5139346

uncommitted_changes="$(git status --porcelain)"

if [ -n "$uncommitted_changes" ]; then
echo "There are some uncommitted changes"
echo "$uncommitted_changes"
exit 1;
else
exit 0;
fi

0 comments on commit 4387564

Please sign in to comment.