mirror of
https://pagure.io/fedora-comps.git
synced 2024-12-21 12:38:31 +01:00
5ce7252e20
`make sort` won't usually *fail*, even if it sorts stuff (it'll only fail if it actually can't sort for some reason). So when either the PR or the existing state of the repo isn't properly sorted, what we get is the "git status failed!" case. I *think* this is likely the only time we'll get that, I don't think "make validate" would actually change files without failing. So let's gloss that a git status failure probably means a sorting issue. Signed-off-by: Adam Williamson <awilliam@redhat.com>
28 lines
570 B
Bash
Executable file
28 lines
570 B
Bash
Executable file
#!/usr/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
main() {
|
|
failure=0
|
|
|
|
make sort > /dev/null 2>&1 || {
|
|
echo "Sort failed!"
|
|
((failure+=1))
|
|
}
|
|
make validate || {
|
|
echo "Validate failed!"
|
|
((failure+=1))
|
|
}
|
|
|
|
# Fail if any changes were made to the repo
|
|
if [[ -n $(git status --short) ]]; then
|
|
echo "git status failed! This likely means the PR or the underlying repo is not sorted"
|
|
((failure+=1))
|
|
fi
|
|
if [[ $failure -gt 0 ]]; then
|
|
echo "${failure} check(s) failed!"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
main "${@}"
|