mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:39:42 +00:00
Delete .github/workflows/shell-format.yml
This commit is contained in:
66
.github/workflows/shell-format.yml
vendored
66
.github/workflows/shell-format.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: Shell Format & Lint (Minimal)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
format-lint:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install shfmt & shellcheck
|
||||
run: |
|
||||
set -euo pipefail
|
||||
brew update
|
||||
brew install shfmt shellcheck
|
||||
shfmt -version || true
|
||||
shellcheck --version || true
|
||||
|
||||
- name: List target files
|
||||
id: list
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
FILES=$(git ls-files '*.sh' 'mole' || true)
|
||||
echo "FILES<<EOF" >> "$GITHUB_OUTPUT"
|
||||
echo "$FILES" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
if [[ -z "$FILES" ]]; then
|
||||
echo "found=0" >> "$GITHUB_OUTPUT"
|
||||
echo "No shell files found."
|
||||
else
|
||||
echo "found=1" >> "$GITHUB_OUTPUT"
|
||||
echo "Files:"
|
||||
echo "$FILES"
|
||||
fi
|
||||
|
||||
- name: Run shfmt (diff only)
|
||||
if: steps.list.outputs.found == '1'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
shfmt -i 4 -ci -sr -d ${FILES}
|
||||
env:
|
||||
FILES: ${{ steps.list.outputs.FILES }}
|
||||
|
||||
- name: Run shellcheck
|
||||
if: steps.list.outputs.found == '1'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -f .shellcheckrc ]]; then
|
||||
shellcheck --rcfile .shellcheckrc ${FILES}
|
||||
else
|
||||
shellcheck ${FILES}
|
||||
fi
|
||||
env:
|
||||
FILES: ${{ steps.list.outputs.FILES }}
|
||||
|
||||
- name: Nothing to check
|
||||
if: steps.list.outputs.found == '0'
|
||||
run: echo "Skip: no shell files."
|
||||
Reference in New Issue
Block a user