Compare commits
1 commit
0005432b69
...
aaf9ecfc1d
Author | SHA1 | Date | |
---|---|---|---|
|
aaf9ecfc1d |
|
@ -18,15 +18,27 @@ jobs:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch the entire history to avoid REST API reliance
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install ShellCheck
|
- name: Install ShellCheck
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y shellcheck
|
apt-get update && apt-get install -y shellcheck
|
||||||
|
|
||||||
- name: Lint Bash Scripts
|
- name: Find Shell Scripts
|
||||||
|
id: find-scripts
|
||||||
run: |
|
run: |
|
||||||
echo "Linting Bash scripts..."
|
echo "Searching for shell scripts..."
|
||||||
find . -name '*.sh' -print0 | xargs -0 shellcheck -x --exclude=SC1091 --exclude=SC2015
|
find . -name '*.sh' -print0 > shell-scripts.list
|
||||||
|
|
||||||
|
- name: Run ShellCheck in Script Directories
|
||||||
|
run: |
|
||||||
|
echo "Running ShellCheck in each script's directory..."
|
||||||
|
while IFS= read -r -d '' script; do
|
||||||
|
echo "Checking $script"
|
||||||
|
script_dir=$(dirname "$script")
|
||||||
|
script_name=$(basename "$script")
|
||||||
|
# Change to the script's directory and run ShellCheck
|
||||||
|
(cd "$script_dir" && shellcheck -x "$script_name")
|
||||||
|
done < shell-scripts.list
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ while getopts ":f:h:u:p:m:b:" opt; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create a temporary file for the encrypted archive
|
# Create a temporary file for the encrypted archive
|
||||||
|
# shellcheck disable=SC2015
|
||||||
TMP_FILENAME=duplicati_db-$(date +"%Y%m%d").bak &&
|
TMP_FILENAME=duplicati_db-$(date +"%Y%m%d").bak &&
|
||||||
TMP_FILEPATH="$SCRIPT_ABS_LOCATION" || { log "Error: Failed to create a temporary file."; exit 1; }
|
TMP_FILEPATH="$SCRIPT_ABS_LOCATION" || { log "Error: Failed to create a temporary file."; exit 1; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue