GitHub Actions: add shellcheck to PR workflow
authorChris Hofstaedtler <chris@hofstaedtler.name>
Sun, 12 Nov 2023 01:43:28 +0000 (02:43 +0100)
committerChris Hofstaedtler <chris@hofstaedtler.name>
Fri, 17 Nov 2023 15:51:49 +0000 (16:51 +0100)
This reports shellcheck output for *changed* lines. Preexisting problems are
not reported.

.github/workflows/pr-review.yml [new file with mode: 0644]

diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml
new file mode 100644 (file)
index 0000000..19ea46d
--- /dev/null
@@ -0,0 +1,40 @@
+# PR Review workflows.
+# The intention is for these to only find *new* issues.
+
+name: pr-review
+on:
+  pull_request:
+jobs:
+
+  shellcheck-code:
+    name: shellcheck grml-debootstrap
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: shellcheck
+        uses: reviewdog/action-shellcheck@v1
+        with:
+          github_token: ${{ secrets.github_token }}
+          reporter: github-pr-review
+          path: "."
+          pattern: |
+            chroot-script
+            grml-debootstrap
+            config
+            tests/shellcheck-stub-debootstrap-variables
+          check_all_files_with_shebangs: "false"
+
+  shellcheck-tests:
+    name: shellcheck test scripts
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: shellcheck
+        uses: reviewdog/action-shellcheck@v1
+        with:
+          github_token: ${{ secrets.github_token }}
+          reporter: github-pr-review
+          path: "."
+          pattern: |
+            tests/*
+          check_all_files_with_shebangs: "false"