Skip to content

Commit fb49fb8

Browse files
authored
chore: update regen workflow (#13409)
Currently, the regeneration check workflow uses `git diff --exit-code` to verify if code regeneration produced any differences. However, `git diff` only checks tracked files. If the regeneration process creates new files (such as newly generated client files that were previously excluded), they remain untracked and the check passes without reporting a failure. Change the check to use `git status --porcelain` to detect any changes (including modifications, deletions, and untracked files). Add instructions on how to resolve the failure.
1 parent d581adb commit fb49fb8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/librarian_generation_check.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,8 @@ jobs:
6565
librarian generate --all
6666
- name: Check for generated code changes
6767
run: |
68-
git diff --exit-code
68+
if [ -n "$(git status --porcelain)" ]; then
69+
git status
70+
echo "Regeneration produced code changes! Please run 'librarian generate --all' to update the generated files."
71+
exit 1
72+
fi

0 commit comments

Comments
 (0)