Skip to content

Commit 3c3d822

Browse files
authored
feat: stop workflow if no changes
1 parent 5898b16 commit 3c3d822

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ jobs:
110110
-var="mailgun_apikey=${{ secrets.MAILGUN_API_KEY }}" \
111111
-var="backend_image=${{ steps.deploy-vars.outputs.backend_image }}" \
112112
-var="frontend_image=${{ steps.deploy-vars.outputs.frontend_image }}"
113+
terraform show -json tfplan > tfplan.json
114+
if jq -e '.resource_changes | length == 0' tfplan.json >/dev/null; then
115+
echo "no_changes=true" >> "$GITHUB_OUTPUT"
116+
echo "No changes to apply."
117+
exit 0
118+
fi
113119
114120
- name: Upload plan artifact
115121
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)