Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add jon23d/skillz --skill "github-quality-control"
Install specific skill from multi-skill repository
# Description
Use when writing a GitHub Actions workflow that runs tests and linting on push to enforce code quality gates without blocking merges
# SKILL.md
name: github-quality-control
description: Use when writing a GitHub Actions workflow that runs tests and linting on push to enforce code quality gates without blocking merges
GitHub Quality Control Workflow
Overview
A minimal GitHub Actions workflow that enforces code quality on every push by running tests and linting. Results are reported to the PR. Failed runs upload logs for debugging. This does NOT block merges.
When to use
When you need a CI workflow that:
- Runs automatically when code is pushed
- Validates tests pass and linting is clean
- Reports status to GitHub
- Saves logs when checks fail
- Does NOT prevent merging
Core pattern
Copy and adapt this template:
name: Code Quality
on:
push:
branches: [main, develop]
paths:
- '**.ts'
- '**.tsx'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/quality.yml'
permissions:
contents: read
checks: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test --reporter=junit --outputFile=results/test-results.xml
- name: Run linting
run: pnpm lint
- name: Upload failed logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: quality-failure-logs
path: results/
Required elements (must include - NO EXCEPTIONS)
branches: [main, develop]— not'**', notbranches-ignorepaths:filter — only code files ('**.ts','**.tsx','pnpm-lock.yaml')permissions:block with ALL of these:
yaml permissions: contents: read checks: write pull-requests: writeconcurrency:block withcancel-in-progress: true— prevents duplicate runs- Single job named
quality— NOT multiple jobs (test/lint should run sequentially in one job) - Explicit Node.js version —
node-version: '22'with NO conditionals pnpm install --frozen-lockfile— neverinstallwithout lockfile enforcement- Explicit
pnpm testcommand — NO|| true, NO shell conditionals - Explicit
pnpm lintcommand — NO|| true, NO shell conditionals - Artifact upload on failure —
if: failure()withupload-artifact path: '.github/workflows/quality.yml'— triggers when workflow itself changes
Forbidden patterns (NEVER do these - NO EXCEPTIONS)
branches-ignore— usebranches+paths-ignoreinsteadbranches: '**'orbranches: "*"— too broad, runs on every branch|| trueafter commands — this silences failures; remove it and let pytest/ruff fail naturally- Multiple jobs (e.g., separate
test:andlint:jobs) — use onequality:job with sequential steps - Missing
checks: writeorpull-requests: writein permissions — PR checks won't report - Missing
cancel-in-progress: true— wastes CI minutes on duplicate runs - Missing
.github/workflows/quality.ymlinpaths:— workflow changes won't retrigger - Shell conditionals for test/lint — don't detect runtime; specify one:
pnpm testorpnpm lint
What each element does
| Element | Purpose |
|---|---|
paths: |
Runs CI only when code changes, not when docs/markdown change |
permissions: |
Allows workflow to write check status and PR comments |
concurrency + cancel-in-progress |
Stops duplicate runs when you push 3x rapidly |
if: failure() |
Only uploads artifacts when something actually broke |
name: in upload-artifact |
Makes logs easy to find in the workflow UI |
Common mistakes
| Wrong | Right |
|---|---|
branches: '**' |
branches: [main, develop] |
branches-ignore: [main] |
branches: [main] with paths-ignore for docs |
| No permissions block | permissions: {contents: read, checks: write} |
setup-node without version |
with: {node-version: '22'} |
| No artifact on failure | if: failure() + upload-artifact |
pnpm test \|\| true |
Just pnpm test (let it fail naturally) |
Red flags — stop and reassess
- Workflow has conditional steps (
if:) for runtime detection → specify one runtime - More than one job defined → quality gate should be one job
- Workflow exceeds 75 lines → too complex for simple quality check; trim steps or consolidate
- Using
branches-ignoreanywhere → usebranches+paths-ignoreinstead - No concurrency block → duplicate runs waste CI quota
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.