2023-02-03 12:58:20 +01:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
2023-04-24 11:06:29 -07:00
|
|
|
set -euo pipefail
|
2023-02-03 12:58:20 +01:00
|
|
|
|
|
|
|
main() {
|
2023-04-24 10:49:28 -07:00
|
|
|
failure=0
|
2023-02-03 12:58:20 +01:00
|
|
|
|
2023-04-24 10:49:28 -07:00
|
|
|
make sort > /dev/null 2>&1 || {
|
|
|
|
echo "Sort failed!"
|
|
|
|
((failure+=1))
|
|
|
|
}
|
|
|
|
make validate || {
|
|
|
|
echo "Validate failed!"
|
|
|
|
((failure+=1))
|
|
|
|
}
|
2023-02-03 12:58:20 +01:00
|
|
|
|
|
|
|
# Fail if any changes were made to the repo
|
2023-04-24 10:50:37 -07:00
|
|
|
if [[ -n $(git status --short) ]]; then
|
2023-05-18 09:08:28 -07:00
|
|
|
echo "git status failed! This likely means the PR or the underlying repo is not sorted"
|
2023-04-24 10:49:28 -07:00
|
|
|
((failure+=1))
|
2023-02-03 12:58:20 +01:00
|
|
|
fi
|
2023-04-24 10:49:28 -07:00
|
|
|
if [[ $failure -gt 0 ]]; then
|
|
|
|
echo "${failure} check(s) failed!"
|
2023-02-03 12:58:20 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|