mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
ci: Check that non-scripts aren’t marked executable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
761ca16d6d
commit
872f4b41c1
9
tools/ci/check-executables
Executable file
9
tools/ci/check-executables
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
files="$(git ls-tree -r @ | sed -n 's/^100755 blob \S\+\t//p' | xargs -r grep -Lz '^#!' --)" || [ $? = 123 ]
|
||||
if [ "$files" ]; then
|
||||
echo 'error: non-scripts should not be marked executable (fix with chmod -x):'
|
||||
echo
|
||||
printf '%s\n' "$files"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user