mirror of
https://github.com/terem42/zfs-hetzner-vm.git
synced 2025-12-22 14:58:32 +00:00
updated shellcheck workflow
This commit is contained in:
23
.github/workflows/shellcheck.yml
vendored
23
.github/workflows/shellcheck.yml
vendored
@@ -1,24 +1,11 @@
|
||||
name: shellcheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, develop]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
Shellcheck:
|
||||
name: Shellcheck
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check scripts with Shellcheck
|
||||
uses: essentialkaos/shellcheck-action@v1
|
||||
with:
|
||||
files: hetzner-debian10-zfs-setup.sh hetzner-debian11-zfs-setup.sh hetzner-ubuntu18-zfs-setup.sh hetzner-ubuntu20-zfs-setup.sh
|
||||
severity: error
|
||||
format: gcc
|
||||
shell: bash
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run shellcheck
|
||||
run: ci/run_shellcheck.sh
|
||||
25
ci/run_shellcheck.sh
Normal file
25
ci/run_shellcheck.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o errtrace
|
||||
shopt -s inherit_errexit
|
||||
|
||||
# Always download the latest version:
|
||||
#
|
||||
# - it's fast and stable enough not to worry about it;
|
||||
# - the workflow is basically single-person, so there's no risk of a new dev encountering an error found
|
||||
# by a new shellcheck version.
|
||||
|
||||
mkdir -p /opt/shellcheck
|
||||
|
||||
wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz \
|
||||
| tar xJv -O shellcheck-stable/shellcheck \
|
||||
> /opt/shellcheck/shellcheck
|
||||
|
||||
chmod +x /opt/shellcheck/shellcheck
|
||||
|
||||
/opt/shellcheck/shellcheck --version
|
||||
|
||||
grep -lZP '^#!/bin/\w+sh' -R | xargs -0 /opt/shellcheck/shellcheck
|
||||
Reference in New Issue
Block a user