From 887d714e7d61ec1b7ccf870a78a18d8bbe64974b Mon Sep 17 00:00:00 2001 From: Samuel Manzer Date: Mon, 27 Nov 2023 20:51:46 -0800 Subject: [PATCH] Github: Add Shellcheck Action Summary: * Add a dedicated shellcheck action to Github actions * We now get this functionality with the current faster concurrent setup instead of earlier serial pre-commit setup * All of our existing shell scripts pass shellcheck Differential Revision: D51608963 --- .github/workflows/shellcheck.yaml | 21 +++++++++++++++++++++ test.sh | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/shellcheck.yaml create mode 100644 test.sh diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/shellcheck.yaml new file mode 100644 index 00000000..844d73d1 --- /dev/null +++ b/.github/workflows/shellcheck.yaml @@ -0,0 +1,21 @@ +--- +name: Shellcheck +on: + pull_request: + types: + - opened + - synchronize +jobs: + shellcheck: + name: Run Shellcheck + runs-on: ubuntu-latest + steps: + - name: Install Shellcheck + run: | + sudo apt update + sudo apt install -y shellcheck + - name: Checkout Git repository + uses: actions/checkout@v4 + - name: Run Shellcheck + run: | + shellcheck **/*.sh diff --git a/test.sh b/test.sh new file mode 100644 index 00000000..f5b7d0b1 --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +$result="foo" +[[ $1 == $result ]] && echo "victory"