Skip to content

chore: add Husky pre-commit hooks and auto-merge workflow#130

Merged
tomymaritano merged 4 commits into
developfrom
feature/husky-automerge
Mar 12, 2026
Merged

chore: add Husky pre-commit hooks and auto-merge workflow#130
tomymaritano merged 4 commits into
developfrom
feature/husky-automerge

Conversation

@tomymaritano

Copy link
Copy Markdown
Collaborator

Summary

  • Install Husky + lint-staged for pre-commit formatting checks
  • Add GitHub Actions auto-merge workflow for owner PRs that pass CI
  • Auto-merge dependabot PRs after CI passes
  • External contributors still require CODEOWNERS review

Setup required

After merging, enable branch protection on develop:

  1. Settings → Branches → Add rule for develop
  2. Require status checks: lint, test, typecheck
  3. Enable "Allow auto-merge"

Test plan

  • Husky pre-commit hook runs lint-staged on commit
  • All tests pass
  • Auto-merge workflow triggers on CI completion

🤖 Generated with Claude Code

- Install Husky + lint-staged for pre-commit formatting
- Add auto-merge workflow for owner PRs that pass CI
- Auto-merge dependabot PRs after CI passes
- External contributors' PRs still require owner review (CODEOWNERS)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c5510136-eb3b-4830-8dad-3a3bd7207de2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/husky-automerge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Replace peter-evans action with gh CLI which doesn't need
pull-request-number input and works directly with PR events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09ac09a67f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/automerge.yml Outdated
runs-on: ubuntu-latest
if: >-
github.event.pull_request.user.login == 'tomymaritano' ||
github.event.workflow_run.head_repository.owner.login == 'tomymaritano'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate owner auto-merge to PR-based workflow runs

This condition matches owner workflow_run events from normal branch pushes as well as PRs, and CI is configured to run on push to main/develop in .github/workflows/ci.yml. For those push-triggered completions there is no pull request in the event payload, but the job still calls peter-evans/enable-pull-request-automerge@v3 without a pull-request-number, so the auto-merge job will fail/no-op on regular owner pushes instead of only handling PRs. Add a guard for PR-originated workflow runs (for example checking github.event.workflow_run.event == 'pull_request' or workflow_run.pull_requests presence) before invoking the action.

Useful? React with 👍 / 👎.

Husky hooks:
- commit-msg: validate conventional commits with commitlint
- pre-push: run tests + typecheck before pushing

CI improvements (Tier 1 - Speed):
- Shared setup job with cached node_modules
- Cancel in-progress runs on new pushes
- Turborepo-ready with env vars

CI improvements (Tier 2 - Quality):
- Test coverage collection and artifact upload
- Bundle size tracking reported in PR summary
- PR size labels (XS/S/M/L/XL)
- Auto-label PRs by changed packages

CI improvements (Tier 3 - Security):
- npm audit check for high severity vulnerabilities
- License compatibility check (blocks GPL-3.0/AGPL/SSPL)
- CodeQL static analysis (weekly + on PR)
- Commitlint on PR titles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file ci size/XL labels Mar 12, 2026
plugin-api is browser code without @types/node, so process.env causes
typecheck failures. The debug log is low-cost and harmless in production.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@tomymaritano tomymaritano merged commit 40c5216 into develop Mar 12, 2026
9 of 13 checks passed
@tomymaritano tomymaritano deleted the feature/husky-automerge branch March 12, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci dependencies Pull requests that update a dependency file package:plugin-api size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants