From 7a5acc130138bd28dacb1279068ba8de3dc74f72 Mon Sep 17 00:00:00 2001 From: Jonathan Zhang Date: Fri, 1 May 2026 08:22:00 -0700 Subject: [PATCH 1/2] chore(ci): add actionlint + prettier check on PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ci-workflows hosts reusable workflows that other projects pull in via `uses:`. A typo here (bad expression syntax, deprecated runner, undefined `steps.X` output ref) silently breaks every downstream consumer. CI gate prevents that. Why not husky/lint-staged: this repo has no package.json. Pulling in a JS toolchain to format three files isn't worth the dependency footprint. CI-only enforcement is the right shape for a YAML+Markdown repo — actionlint covers the GHA-specific bugs prettier can't see, and prettier covers the README. Bundled in the same PR (small fixes that would otherwise immediately fail the new lint job): - `pr-classify.yml`: shellcheck inline disable for SC2001 on the intentional `sed 's/^/ /'` multiline indent. sed is clearer than the bash parameter-expansion alternative for this case. - `README.md`: prettier --write to clean up pre-existing drift. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/lint.yml | 52 +++++++++++++++++++++++++++++++ .github/workflows/pr-classify.yml | 1 + README.md | 2 ++ 3 files changed, 55 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..f5adb60 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +# QA gate for ci-workflows itself. +# +# This repo hosts reusable workflows that other projects pull in via `uses:`. +# A typo here (bad expression syntax, deprecated runner, undefined `steps.X` +# output ref, etc.) silently breaks every downstream consumer. So we run +# actionlint on every PR + every push to main. +# +# Markdown gets a prettier --check pass for the README so docs drift doesn't +# accumulate. +# +# No husky / lint-staged here — this repo has no package.json and pulling in +# a JS toolchain to format three files isn't worth the dependency footprint. +# CI-only enforcement is the right call for a YAML+Markdown repo. + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + actionlint: + name: actionlint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download actionlint + id: get_actionlint + run: bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + shell: bash + + - name: Run actionlint + run: ${{ steps.get_actionlint.outputs.executable }} -color + shell: bash + + prettier: + name: prettier (markdown) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: prettier --check **/*.md + run: npx --yes prettier@3 --check "**/*.md" diff --git a/.github/workflows/pr-classify.yml b/.github/workflows/pr-classify.yml index 31a6ac1..39fa198 100644 --- a/.github/workflows/pr-classify.yml +++ b/.github/workflows/pr-classify.yml @@ -68,6 +68,7 @@ jobs: echo "class=$class" >> "$GITHUB_OUTPUT" echo "Computed risk class: $class" echo "Changed files:" + # shellcheck disable=SC2001 # multiline indent — sed is clearer than ${var//.../...} echo "$changed" | sed 's/^/ /' - name: Set risk label on PR diff --git a/README.md b/README.md index 5e39ce2..aae8e4e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Reusable GitHub Actions workflows for solo-dev fleet management. Runs Anthropic's [`claude-code-action@v1`](https://github.com/anthropics/claude-code-action) on PRs to post inline review comments. Caller passes `ANTHROPIC_API_KEY` as a secret. **Inputs:** + - `review_focus` (string, optional) — appended to the base review prompt for project-specific guidance - `checkout_depth` (number, default `0`) — git fetch-depth (0 = full history) @@ -19,6 +20,7 @@ Runs Anthropic's [`claude-code-action@v1`](https://github.com/anthropics/claude- Auto-merges Dependabot PRs for patch (and optionally minor) version bumps once required checks pass. **Inputs:** + - `merge_method` (string, default `squash`) — `merge` | `squash` | `rebase` - `allow_minor` (bool, default `true`) — also merge minor bumps From f3b510e0e6a450de9b7d2820117a2e41421c63ea Mon Sep 17 00:00:00 2001 From: Jonathan Zhang Date: Fri, 1 May 2026 08:54:55 -0700 Subject: [PATCH 2/2] chore(ci): make lint.yml reusable via workflow_call Adds workflow_call trigger so other repos can call this via uses: topcoder1/ci-workflows/.github/workflows/lint.yml@main Existing pull_request + push: main triggers stay so the workflow self-tests on this repo. Inputs (all optional, sensible defaults): - markdown_glob (default '**/*.md') - run_actionlint (default true) - run_prettier (default true) Per-job `if:` guards skip jobs when called with the corresponding input set to false; for non-workflow_call invocations both jobs always run. Companion change: ~/.claude/templates/ci-workflows/{callers,scripts}/ gains lint.yml caller template + install-lint.sh installer (mirrors install-pr-review.sh shape). Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/lint.yml | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f5adb60..0d032c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,23 +1,46 @@ name: Lint -# QA gate for ci-workflows itself. +# Two roles for this workflow: # -# This repo hosts reusable workflows that other projects pull in via `uses:`. -# A typo here (bad expression syntax, deprecated runner, undefined `steps.X` -# output ref, etc.) silently breaks every downstream consumer. So we run -# actionlint on every PR + every push to main. +# 1. Self-test: triggers on pull_request + push to main of *this repo* so that +# typos in the reusable workflows here get caught before they break every +# downstream consumer. # -# Markdown gets a prettier --check pass for the README so docs drift doesn't -# accumulate. +# 2. Reusable: other repos can call it via +# jobs: +# lint: +# uses: topcoder1/ci-workflows/.github/workflows/lint.yml@main +# See callers/lint.yml in the templates dir for a copy-paste-ready caller. # -# No husky / lint-staged here — this repo has no package.json and pulling in -# a JS toolchain to format three files isn't worth the dependency footprint. -# CI-only enforcement is the right call for a YAML+Markdown repo. +# What it checks: +# - actionlint on every .github/workflows/*.yml (catches GHA-specific bugs + +# embedded shellcheck for `run:` blocks) +# - prettier --check on the markdown glob (default **/*.md) +# +# Why no husky/lint-staged: this is meant to plug into repos with mixed +# tooling (or none). CI-only enforcement keeps the dependency surface flat. on: pull_request: push: branches: [main] + workflow_call: + inputs: + markdown_glob: + description: "Glob passed to prettier --check. Default '**/*.md'." + required: false + type: string + default: "**/*.md" + run_actionlint: + description: "Run actionlint job. Default true." + required: false + type: boolean + default: true + run_prettier: + description: "Run prettier --check on markdown. Default true." + required: false + type: boolean + default: true permissions: contents: read @@ -25,6 +48,7 @@ permissions: jobs: actionlint: name: actionlint + if: ${{ github.event_name != 'workflow_call' || inputs.run_actionlint }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -40,6 +64,7 @@ jobs: prettier: name: prettier (markdown) + if: ${{ github.event_name != 'workflow_call' || inputs.run_prettier }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -48,5 +73,5 @@ jobs: with: node-version: "20" - - name: prettier --check **/*.md - run: npx --yes prettier@3 --check "**/*.md" + - name: prettier --check ${{ inputs.markdown_glob || '**/*.md' }} + run: npx --yes prettier@3 --check "${{ inputs.markdown_glob || '**/*.md' }}"