Skip to content

Commit ca0f664

Browse files
author
Jay Prall
committed
chore: add check for uncommitted changes post-deploy
1 parent e903ce3 commit ca0f664

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,24 @@ jobs:
8282

8383
- name: Invalidate Cloudfront
8484
run: aws cloudfront create-invalidation --distribution-id ${{ steps.terragrunt_output.outputs.distribution_id }} --paths "/*"
85+
86+
- name: Check for uncommitted changes
87+
run: |
88+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
89+
90+
echo "Git status after build:"
91+
git status
92+
93+
CHANGES="$(git status --porcelain)"
94+
if [ -n "$CHANGES" ]; then
95+
echo "❌ Uncommitted changes detected in the repository."
96+
echo "These files changed (format: XY path):"
97+
echo "$CHANGES"
98+
99+
echo "::error::Your deployment produced uncommitted changes. \
100+
This usually means something should be added to .gitignore or a lockfile/other tracked file needs updating."
101+
exit 1
102+
else
103+
echo "✅ No uncommitted changes after deploy."
104+
fi
105+

0 commit comments

Comments
 (0)