Skip to content

Commit

Permalink
Merge pull request #3 from cslant/shellcheck
Browse files Browse the repository at this point in the history
#2 feat: add shellcheck workflow
  • Loading branch information
tanhongit authored Jan 6, 2025
2 parents 6c6a286 + 23c6c0a commit 31d7efe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -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'
1 change: 1 addition & 0 deletions runner.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -a
# shellcheck disable=SC1091
source .env
set +a
set -ue
Expand Down
5 changes: 3 additions & 2 deletions setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 31d7efe

Please sign in to comment.