OrcaSlicer/.github/workflows/shellcheck.yml
coryrc 7aa3ce8a4d
Some checks failed
Shellcheck / Shellcheck (push) Has been cancelled
Shellcheck everything (#10730)
* Shellcheck all shell scripts

* Implement Shellcheck's recommendations

* Shellcheck the distribution-specific files

* Include the distro scripts to trigger action

* Fix array usage (hopefully)

* Use single-quote string

TIL: single quote string in yaml treats everything as literal, but
double quote allows backslash escaping.

* Make all cmake commands use set+-x dance and fix macos getopts line

Make Claude happy

getopts has colon after a command which takes an argument

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-09-20 09:12:31 +08:00

44 lines
1.2 KiB
YAML

on:
push:
paths:
- '**.sh'
- 'scripts/linux.d/*'
pull_request:
paths:
- '**.sh'
- 'scripts/linux.d/*'
schedule:
- cron: '55 7 * * *' # run once a day near midnight US Pacific time
workflow_dispatch: # allows for manual dispatch
name: "Shellcheck"
permissions: {}
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Cache shellcheck download
id: cache-shellcheck-v0_11
uses: actions/cache@v4
with:
path: ~/shellcheck
key: ${{ runner.os }}-shellcheck-v0_11
- name: Download shellcheck
if: steps.cache-shellcheck-v0_11.outputs.cache-hit != 'true'
shell: bash
env:
INPUT_VERSION: "v0.11.0"
run: |
curl -L#o ~/sc.tar.xz "https://github.com/koalaman/shellcheck/releases/download/${INPUT_VERSION}/shellcheck-${INPUT_VERSION}.linux.x86_64.tar.xz"
tar -xvf ~/sc.tar.xz -C ~
mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Shellcheck scripts
run: 'find . -not -name \*.md \( -path ./scripts/linux.d/\* -o -name \*.sh \) -print0 | xargs -0 ~/shellcheck'