-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: verify no untracked files in the clients folder (#7905)
* add verify_clients_untracked_files.sh * fix job * review fixes * add make target
- Loading branch information
1 parent
ce49db6
commit e58e606
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
echo "Checking for untracked files in 'clients/'..." | ||
|
||
if git status --porcelain clients/ | grep -E '^\?\?'; then | ||
cat << EOF | ||
Error: Untracked files found in the 'clients/' directory. | ||
The 'clients/' directory contains auto-generated code that must be tracked in Git. Untracked files suggest new files were created and need to be added. | ||
To resolve this: | ||
1. Remove the 'clients/' directory: | ||
rm -fr clients/ | ||
2. Restore 'clients/' to the last commit: | ||
git restore -- clients/ | ||
3. Regenerate files in 'clients/': | ||
make gen | ||
4. Stage the regenerated files: | ||
git add clients/ | ||
5. Commit the changes: | ||
git commit -m 'Regenerate clients/ files' | ||
EOF | ||
exit 1 | ||
else | ||
echo "No untracked files found." | ||
exit 0 | ||
fi |