Commit d8eb059
authored
Add zizmor pre-commit hook and fix security issues (#25)
This PR adds the
[zizmor](https://github.com/zizmorcore/zizmor-pre-commit) pre-commit
hook to catch GitHub Actions security vulnerabilities and fixes all
existing findings.
## Changes
1. **Added zizmor pre-commit hook** (v1.23.1) to
`.pre-commit-config.yaml`
2. **Fixed all security issues** found by zizmor auto-fix and manual
fixes:
- `template-injection`: Moved GitHub context expressions to environment
variables
- `secrets-outside-env`: Added `environment:` declarations to jobs using
secrets
- `dangerous-triggers`: Replaced `pull_request_target` with
`pull_request`
- `bot-conditions`: Changed `github.actor` checks to
`github.event.pull_request.user.login`
- `excessive-permissions`: Moved workflow-level permissions to job-level
- `superfluous-actions`: Replaced third-party actions with native tools
## Verification
All workflows now pass zizmor security audit with zero errors/warnings.
## Documentation
- [zizmor documentation](https://docs.zizmor.sh/)
- [zizmor pre-commit
hook](https://github.com/zizmorcore/zizmor-pre-commit)1 parent 1df94c3 commit d8eb059
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
28 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
0 commit comments