diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..3cfc3d8 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,19 @@ +name: Shellcheck Action + +on: [ push, pull_request ] + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Copy .env.example to .env + run: cp .env.example .env + + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + with: + check_together: 'yes' diff --git a/runner.sh b/runner.sh index 4e72789..e40adb2 100755 --- a/runner.sh +++ b/runner.sh @@ -1,6 +1,7 @@ #!/bin/bash set -a +# shellcheck disable=SC1091 source .env set +a set -ue diff --git a/setup/functions.sh b/setup/functions.sh index f5da186..02df04a 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -17,6 +17,7 @@ build_fe() { if ! command -v nvm &> /dev/null; then # shellcheck disable=SC2155 export NVM_DIR="$HOME/.nvm" + # shellcheck disable=SC1091 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" fi nvm use "$NODE_VERSION" @@ -97,10 +98,10 @@ build_admin() { if [ ! -f "$BLOG_ADMIN_DIR/.env" ]; then echo ' ∟ .env file missing, copying from .env.example...' cp "$BLOG_ADMIN_DIR/.env.production" "$BLOG_ADMIN_DIR/.env" - composer $COMPOSER_COMMAND + composer "$COMPOSER_COMMAND" /usr/bin/php8.3 artisan key:generate else - composer $COMPOSER_COMMAND + composer "$COMPOSER_COMMAND" fi if [ "$ENV" = "dev" ]; then