Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/scandir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ jobs:

- name: Verify check
run: |
expect="testfiles/scandir/run[[:space:]]me.bash"
expect1="testfiles/scandir/run[[:space:]]me.bash"
expect2="testfiles/scandir/exec"
notexpect="testfiles/test.bash"

if [[ ! "${{ steps.one.outputs.files }}" =~ $expect ]];then
echo "::error:: Expected file $expect not found in ${{ steps.one.outputs.files }}"
if [[ ! "${{ steps.one.outputs.files }}" =~ $expect1 ]];then
echo "::error:: Expected file $expect1 not found in ${{ steps.one.outputs.files }}"
exit 1
elif [[ ! "${{ steps.one.outputs.files }}" =~ $expect2 ]];then
echo "::error:: Expected file $expect2 not found in ${{ steps.one.outputs.files }}"
exit 1
elif [[ "${{ steps.one.outputs.files }}" =~ $notexpect ]];then
echo "::error:: Expected file $notexpect found in ${{ steps.one.outputs.files }}"
Expand Down
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ runs:
')' \
-print0)

perm_executable="/111"
# BSD find on macOS does not support the slash syntax for permissions.
[ "$(uname -s)" = "Darwin" ] && perm_executable="+111"

while IFS= read -r -d '' file; do
head -n1 "$file" | grep -Eqs "$shebangregex" || continue
filepaths+=("$file")
done < <(find "${INPUT_SCANDIR}" \
${INPUT_EXCLUDE_ARGS} \
-type f ! -name '*.*' -perm /111 \
-type f ! -name '*.*' -perm "$perm_executable" \
-print0)

if [[ -n "${INPUT_CHECK_TOGETHER}" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions testfiles/scandir/exec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

echo "I am executable"