Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ jobs:

This repository keeps a local example workflow in `.github/workflows/main.yml`. It uses `pull_request` and `uses: ./` so changes in the current branch are tested before release. That pattern should stay limited to the action repository itself, because a local action from an untrusted fork must not run with `pull_request_target`.

## Development

Install [lefthook](https://github.com/evilmartians/lefthook) and run:

```sh
lefthook install
```

This sets up the following Git hooks:

- **pre-commit**: runs `bun run lint` (Biome checks) — fast static feedback before each commit.
- **pre-push**: runs `bun run lint` and `bun run test` — full local validation before pushing.

CI still runs the complete suite on every pull request and push to main; the hooks bring that feedback earlier in your workflow.

## License

MIT
13 changes: 13 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Clear Git hook environment variables before running checks so nested or sibling
# repositories are not affected: https://git-scm.com/docs/githooks
pre-commit:
jobs:
- name: lint
run: for name in $(env | sed -n 's/^\(GIT_[A-Za-z0-9_]*\)=.*/\1/p'); do unset "$name"; done; bun run lint

pre-push:
jobs:
- name: lint
run: for name in $(env | sed -n 's/^\(GIT_[A-Za-z0-9_]*\)=.*/\1/p'); do unset "$name"; done; bun run lint
- name: test
run: for name in $(env | sed -n 's/^\(GIT_[A-Za-z0-9_]*\)=.*/\1/p'); do unset "$name"; done; bun run test