Skip to content

Commit

Permalink
feat: add a check for up-to-date Django message files
Browse files Browse the repository at this point in the history
use the same workflow to minimize time spent on required checks
  • Loading branch information
angela-tran committed Jun 10, 2024
1 parent 2feb724 commit f9568a1
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/check-makemigrations.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for up-to-date Django migrations
name: Check for up-to-date Django migrations and messages
on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -26,7 +26,23 @@ jobs:
run: |
if ./bin/makemigrations.sh | grep -q 'No changes detected';
then
exit 0;
exit 0;
else
exit 1;
exit 1;
fi
- name: Run ./bin/makemessages.sh
run: |
./bin/makemessages.sh
set -x # show commands
git add benefits
# message files are up-to-date if the only differences are from the updated timestamp
if echo $(git diff --cached --shortstat) | grep -q '2 files changed, 2 insertions(+), 2 deletions(-)';
then
exit 0;
else
exit 1;
fi

0 comments on commit f9568a1

Please sign in to comment.