Maintenance: make shellcheck stricter to fail on 'warning' messages, and remove lint-bash-scripts from Github CI.

This commit is contained in:
Martin Gruner 2021-06-18 10:44:24 +02:00
parent 333d4aef8c
commit 63825b012d
7 changed files with 10 additions and 35 deletions

View File

@ -1,18 +0,0 @@
#!/bin/sh
#
# lint bash scripts
#
set -o errexit
CONFIG_DIR=".github"
TMP_FILE="$(mktemp)"
find "${CONFIG_DIR}" -type f -name "*.sh" > "${TMP_FILE}"
while read -r FILE; do
echo lint "${FILE}"
shellcheck -x "${FILE}"
done < "${TMP_FILE}"

View File

@ -4,19 +4,8 @@ on:
pull_request
jobs:
lint-bash-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Lint Bash scripts
uses: docker://koalaman/shellcheck-alpine:v0.7.0
with:
args: .github/lint-scripts.sh
ci:
runs-on: ubuntu-latest
needs: lint-bash-scripts
services:
mysql:
image: mysql:5

View File

@ -4,10 +4,12 @@
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:
# shellcheck disable=SC2046
BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"
if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then
# Ensure we're inside of our Backup-Script folder (see issue 2508)
# shellcheck disable=SC2164
cd "${BACKUP_SCRIPT_PATH}"
# import config

View File

@ -4,6 +4,7 @@
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:
# shellcheck disable=SC2046
BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"
if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then

View File

@ -22,7 +22,8 @@ function check_os()
# Debian
if [ -f /etc/debian_version ]; then
OS=Debian
local MAJOR=$(cut -d. /etc/debian_version -f1)
local MAJOR
MAJOR=$(cut -d. /etc/debian_version -f1)
if [ $MAJOR -lt 7 ]; then
echo Please check the supported operating systems
exit 1
@ -54,9 +55,9 @@ fi
HOMEDIR=$(getent passwd $USER | cut -d: -f 6)
GROUP=$(id -gn $USER)
cd "${HOMEDIR}"
cd "${HOMEDIR}" || exit 1
sudo -u "${USER}" -H git clone $REPOURL zammad
cd zammad
cd zammad || exit 1
LATEST=$(git tag --list|sort|tail -1)
git checkout tags/"${LATEST}"
chown -R "${USER}":"${GROUP}" .

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
echo "Zammad S/MIME test certificate generation"
@ -79,6 +79,7 @@ do
done
echo "Generating from CA chain"
# shellcheck disable=SC2043
for EMAIL_ADDRESS in chain@example.com
do
if [[ ! -e "$CERT_DIR/$EMAIL_ADDRESS.crt" ]]

View File

@ -5,5 +5,4 @@ set -o pipefail
docker build --no-cache -t zammad/smime-test-certificates:latest .
docker run --rm -v `pwd`/../:/etc/ssl/certs zammad/smime-test-certificates:latest
docker run --rm -v "$(pwd)/../:/etc/ssl/certs" zammad/smime-test-certificates:latest