From 90904b3f420d41cf56c62b6d96234b199399f3e4 Mon Sep 17 00:00:00 2001 From: Dre Date: Sat, 18 Jul 2020 00:49:32 +1000 Subject: [PATCH] workflow: add shellcheck as a linter (#6202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ᴜɴᴋɴᴡᴏɴ --- .github/workflows/shell.yml | 13 +++++++++++++ scripts/build.sh | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/shell.yml diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml new file mode 100644 index 000000000..1926472ce --- /dev/null +++ b/.github/workflows/shell.yml @@ -0,0 +1,13 @@ +name: Shell +on: + push: + branches: [master] + pull_request: +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master diff --git a/scripts/build.sh b/scripts/build.sh index cf127c2ae..53dcdf6ad 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,11 +1,13 @@ +#!/bin/bash + outPath=./output rm -rf $outPath mkdir $outPath go build ../gogs.go -PLATFORM=`uname | cut -d _ -f 1` -if [ $PLATFORM = "MINGW32" ] || [ $PLATFORM = "MINGW64" ] || [ $PLATFORM = "CYGWIN" ]; then +PLATFORM=$(uname | cut -d _ -f 1) +if [ "$PLATFORM" = "MINGW32" ] || [ "$PLATFORM" = "MINGW64" ] || [ "$PLATFORM" = "CYGWIN" ]; then GOGS_EXE=gogs.exe else GOGS_EXE=gogs @@ -28,4 +30,4 @@ cp ../README_ZH.md $outPath/ cp start.bat $outPath/ cp start.sh $outPath/ cp ../wercker.yml $outPath/ -cp mysql.sql $outPath/ \ No newline at end of file +cp mysql.sql $outPath/