Skip to content

Commit

Permalink
Check file permissions (x-bit).
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Dec 4, 2024
1 parent afe24b3 commit 1d792fd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ArtifactsUpload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
mkdir -p bin
echo "Program $(date --utc '+%d.%m.%Y - %H:%M:%S')" > bin/program.py
chmod u+x bin/program.py
mkdir -p lib
echo "Library $(date --utc '+%d.%m.%Y - %H:%M:%S')" > lib/common.py
chmod +x lib/common.py
- name: 🔎 Inspect directory structure
run: |
Expand Down Expand Up @@ -125,3 +127,35 @@ jobs:
else
echo -e "${ANSI_LIGHT_GREEN}No errors found.${ANSI_NOCOLOR}"
fi
- name: 📋 Verify file permissions
run: |
set +e
ANSI_LIGHT_RED="\e[91m"
ANSI_LIGHT_GREEN="\e[92m"
ANSI_NOCOLOR="\e[0m"
expected=(
"bin/program.py"
"lib/common.py"
)
errors=0
for file in "${expected[@]}"; do
echo -n "Checking '${file}' ... "
if [[ -x "$file" ]]; then
echo -e "${ANSI_LIGHT_GREEN}[PASSED]${ANSI_NOCOLOR}"
else
echo -e "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}"
echo -e "${ANSI_LIGHT_RED}File '${file}' isn't executable.${ANSI_NOCOLOR}"
errors=$((errors + 1))
fi
done
echo ""
if [[ $errors -ne 0 ]]; then
echo -e "${ANSI_LIGHT_RED}Counted ${errors} errors.${ANSI_NOCOLOR}"
else
echo -e "${ANSI_LIGHT_GREEN}No errors found.${ANSI_NOCOLOR}"
fi

0 comments on commit 1d792fd

Please sign in to comment.