-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use local actions to verify directory contents and file permissions.
- Loading branch information
Showing
3 changed files
with
131 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Check-Directory-Content | ||
description: Check if directory contains the listed files. | ||
inputs: | ||
files: | ||
description: List of filenames. | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 📋 Verify extracted tarball content | ||
shell: bash | ||
run: | | ||
set +e | ||
ANSI_LIGHT_RED="\x1b[91m" | ||
ANSI_LIGHT_GREEN="\x1b[92m" | ||
ANSI_NOCOLOR="\x1b[0m" | ||
errors=0 | ||
while IFS=$'\r\n' read -r file; do | ||
echo -n "Checking '${file}' ... " | ||
if [[ -f "$file" ]]; then | ||
echo "${ANSI_LIGHT_GREEN}[PASSED]${ANSI_NOCOLOR}" | ||
else | ||
echo "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" | ||
echo "${ANSI_LIGHT_RED}Extracted artifact doesn't contain file '${file}'.${ANSI_NOCOLOR}" | ||
errors=$((errors + 1)) | ||
fi | ||
done <<<'${{ inputs.files }}' | ||
echo "" | ||
if [[ $errors -ne 0 ]]; then | ||
echo "${ANSI_LIGHT_RED}Counted ${errors} errors.${ANSI_NOCOLOR}" | ||
exit 1 | ||
else | ||
echo "${ANSI_LIGHT_GREEN}No errors found.${ANSI_NOCOLOR}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: File-Is-Executable | ||
description: Check if listed files are executable. | ||
inputs: | ||
files: | ||
description: List of filenames. | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 📋 Verify file permissions | ||
shell: bash | ||
run: | | ||
set +e | ||
ANSI_LIGHT_RED="\x1b[91m" | ||
ANSI_LIGHT_GREEN="\x1b[92m" | ||
ANSI_NOCOLOR="\x1b[0m" | ||
errors=0 | ||
while IFS=$'\r\n' read -r file; do | ||
echo -n "Checking '${file}' ... " | ||
if [[ -x "$file" ]]; then | ||
echo "${ANSI_LIGHT_GREEN}[PASSED]${ANSI_NOCOLOR}" | ||
else | ||
echo "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}" | ||
echo "${ANSI_LIGHT_RED}File '${file}' isn't executable.${ANSI_NOCOLOR}" | ||
errors=$((errors + 1)) | ||
fi | ||
done <<<'${{ inputs.files }}' | ||
echo "" | ||
if [[ $errors -ne 0 ]]; then | ||
echo "${ANSI_LIGHT_RED}Counted ${errors} errors.${ANSI_NOCOLOR}" | ||
exit 1 | ||
else | ||
echo "${ANSI_LIGHT_GREEN}No errors found.${ANSI_NOCOLOR}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters