From 37b02e8ec44dcf874d100451913f3707dd07082a Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Tue, 9 Dec 2025 17:21:11 -0500 Subject: [PATCH] chore(ci): skip build workflow for non-code changes Skip linting, building, and testing when only non-code files change: - Documentation (*.md, docs/) - Assets (assets/, schemas/) - GitHub templates (.github/ISSUE_TEMPLATE/) - IDE/editor config (.idea/, .claude/) - Git config (.gitignore) - Commit lint config (.commitlintrc.yml, package.json, package-lock.json) - Install scripts (install.sh, install.ps1) - LICENSE Add new script-lint.yml workflow that runs ShellCheck and PSScriptAnalyzer when install scripts change. Commit and PR title linting still runs via commit-lint.yml. --- .github/workflows/build.yml | 30 +++++++++++++++++++ .github/workflows/script-lint.yml | 48 +++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/script-lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ae92a7..010e1c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,38 @@ name: Build & Test on: push: branches: [ main ] + paths-ignore: + - '**.md' + - 'docs/**' + - 'assets/**' + - 'schemas/**' + - '.github/ISSUE_TEMPLATE/**' + - '.idea/**' + - '.claude/**' + - '.gitignore' + - '.commitlintrc.yml' + - 'package.json' + - 'package-lock.json' + - 'LICENSE' + - 'install.sh' + - 'install.ps1' pull_request: branches: [ main ] + paths-ignore: + - '**.md' + - 'docs/**' + - 'assets/**' + - 'schemas/**' + - '.github/ISSUE_TEMPLATE/**' + - '.idea/**' + - '.claude/**' + - '.gitignore' + - '.commitlintrc.yml' + - 'package.json' + - 'package-lock.json' + - 'LICENSE' + - 'install.sh' + - 'install.ps1' permissions: contents: read diff --git a/.github/workflows/script-lint.yml b/.github/workflows/script-lint.yml new file mode 100644 index 0000000..cfceb80 --- /dev/null +++ b/.github/workflows/script-lint.yml @@ -0,0 +1,48 @@ +name: Lint Install Scripts + +on: + push: + branches: [ main ] + paths: + - 'install.sh' + - 'install.ps1' + pull_request: + branches: [ main ] + paths: + - 'install.sh' + - 'install.ps1' + +permissions: + contents: read + +jobs: + shellcheck: + name: Lint install.sh + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + with: + scandir: '.' + additional_files: 'install.sh' + + psscriptanalyzer: + name: Lint install.ps1 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run PSScriptAnalyzer + shell: pwsh + run: | + Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser + $results = Invoke-ScriptAnalyzer -Path ./install.ps1 -Severity Error,Warning + if ($results) { + $results | Format-Table -AutoSize + exit 1 + } + Write-Host "✅ No issues found in install.ps1"