Files
WebHooker/.github/workflows/lint-format.yml
T
2026-09-30 18:44:10 +08:00

57 lines
1.3 KiB
YAML

name: lint-format
on:
push:
branches: [main]
permissions:
contents: write
concurrency:
group: lint-format-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-format:
name: Lint & Format Fix
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run checks
id: check
continue-on-error: true
run: |
bun run lint
bun run format:check
bun run lint:md
- name: Apply fixes
run: |
bunx eslint . --fix
bunx prettier --write .
bunx markdownlint "**/*.md" --ignore node_modules --ignore dist --fix
- name: Commit and push fixes
if: steps.check.outcome == 'failure'
uses: siiway/verified_bot_commit@v0
with:
message: "chore: auto-fix lint & formatting [skip ci]"
files: "**"
ref: ${{ github.head_ref || github.ref }}
if-no-commit: notice
- name: Verify fixes
run: |
bun run lint
bun run format:check
bun run lint:md