-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add CI/CD automation: linting, formatting checks, and auto-fix workflow #964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "root": true, | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest", | ||
| "sourceType": "module", | ||
| "project": "./tsconfig.json" | ||
| }, | ||
| "plugins": ["@typescript-eslint"], | ||
| "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
| "env": { | ||
| "node": true, | ||
| "es2024": true | ||
| }, | ||
| "rules": { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "argsIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_" | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-explicit-any": "warn", | ||
| "@typescript-eslint/consistent-type-imports": "error", | ||
| "no-console": "warn", | ||
| "no-debugger": "error", | ||
| "prefer-const": "error", | ||
| "no-var": "error" | ||
| }, | ||
| "ignorePatterns": ["node_modules/", "dist/", "test/fixtures/"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,126 @@ | ||||||||||||||||||||||||||||||||||
| name: Detect and Fix | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||
| branches: [main, master] | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| branches: [main, master] | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| detect: | ||||||||||||||||||||||||||||||||||
| name: Detect Issues | ||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||
| format_failed: ${{ steps.format.outcome == 'failure' }} | ||||||||||||||||||||||||||||||||||
| lint_failed: ${{ steps.lint.outcome == 'failure' }} | ||||||||||||||||||||||||||||||||||
| typecheck_failed: ${{ steps.typecheck.outcome == 'failure' }} | ||||||||||||||||||||||||||||||||||
| test_failed: ${{ steps.test.outcome == 'failure' }} | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| ref: ${{ github.head_ref || github.ref_name }} | ||||||||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+27
|
||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout code (non-PR) | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout code (PRs, including forks) | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |
Copilot
AI
Feb 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All checks in detect use continue-on-error: true and there is no final gating step to fail the job when formatting/lint/typecheck/tests fail. This makes the workflow appear successful even when checks fail (especially on push events where auto-fix won’t run). Add a final step that evaluates the step outcomes (or needs.detect.outputs.*) and exits non-zero when any required check failed, after writing the step summary.
Copilot
AI
Feb 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto-fix runs on every pull_request where lint/format failed, but git push will fail for PRs from forks (read-only token) and may create noisy failures. Add an if guard to skip auto-fix when github.event.pull_request.head.repo.fork is true or when github.event.pull_request.head.repo.full_name != github.repository.
Copilot
AI
Feb 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The audit job claims to perform a security audit, but bun pm ls --all only lists dependencies and (with continue-on-error) won’t fail on known vulnerabilities. Either switch to a real vulnerability scanner/audit command and surface results in the summary, or rename/reword the job so it doesn’t imply vulnerability detection.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,11 @@ | ||
| .DS_Store | ||
| node_modules | ||
| dist/ | ||
| *.log | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| coverage/ | ||
| *.tsbuildinfo | ||
|
|
||
| **/.claude/settings.local.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workflow sets repository-wide
contents: writeandpull-requests: writepermissions for all jobs, includingdetectandaudit, even though they only need read access. Consider setting top-level permissions to read-only (or omit), then granting write permissions only on theauto-fixjob/step that pushes commits.