Skip to content

Commit f75fe14

Browse files
feat: error handling updated
1 parent dc81a34 commit f75fe14

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,28 @@ jobs:
7474
git checkout -b "$BRANCH"
7575
7676
# Normalize line endings and ignore timestamp changes
77-
git add . --renormalize
77+
git add -A # Ensure all changes are added to the stage
7878
7979
# 🧩 Debug: show diff stats before the check
8080
echo "=== GIT STATUS ==="
8181
git status
8282
83-
git add -A
84-
83+
# Show detailed diff
8584
echo "=== GIT DIFF SUMMARY ==="
86-
git diff --staged --stat || true
85+
git diff --cached --stat || true
8786
echo "=== GIT DIFF FULL (trimmed to 100 lines) ==="
88-
git diff --staged | head -n 100 || true
87+
git diff --cached | head -n 100 || true
8988
9089
# Check for real content differences only (ignores EOL & mode changes)
91-
if git diff --name-status | grep -q '^[AM]'; then
92-
echo "Changes detected, creating PR."
93-
echo "pr_required=true" >> "$GITHUB_OUTPUT"
90+
if git diff --cached --name-status | grep -q '^[AM]'; then
91+
echo "Changes detected, creating PR."
92+
echo "pr_required=true" >> "$GITHUB_OUTPUT"
9493
else
95-
echo "No meaningful changes detected — skipping regeneration."
96-
echo "pr_required=false" >> "$GITHUB_OUTPUT"
97-
exit 0
94+
echo "No meaningful changes detected — skipping regeneration."
95+
echo "pr_required=false" >> "$GITHUB_OUTPUT"
96+
exit 0
9897
fi
9998
100-
10199
git commit -m "chore: regenerate client from OpenAPI"
102100
git push https://x-access-token:${PAT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git "$BRANCH"
103101

0 commit comments

Comments
 (0)