Browse Source

workflow: add shellcheck as a linter (#6202)

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
Dre 3 years ago
parent
commit
90904b3f42
2 changed files with 18 additions and 3 deletions
  1. 13 0
      .github/workflows/shell.yml
  2. 5 3
      scripts/build.sh

+ 13 - 0
.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

+ 5 - 3
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/
+cp mysql.sql $outPath/