1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 16:14:44 +00:00

Delete .github/workflows/shell-format.yml

This commit is contained in:
Tw93
2025-10-12 18:03:01 +08:00
committed by GitHub
parent 7a8b7ba9d5
commit d111f18cea

View File

@@ -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."