Skip to content

Commit 3de5fa6

Browse files
fix: restore env fixture coverage
1 parent 6fa4156 commit 3de5fa6

5 files changed

Lines changed: 37 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ npm-debug.log*
2727
.env.*
2828
!.env.example
2929
!.env.sample
30+
!tests/fixtures/**/.env
3031

3132
# OS and editor noise
3233
.DS_Store

.memory/project-memory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Build an open-source deterministic security scanner that helps repository owners
2222
- The package is now published to npm as `security-first-aid@0.1.2`.
2323
- Public execution through `npx security-first-aid@latest ...` has been verified, including the no-argument quick-start guide.
2424
- Global npm installs now print a post-install quick-start guide.
25+
- Fixture `.env` files under `tests/fixtures/` are now intentionally unignored so CI and local scans exercise the same secret/env rules.
2526
- Release hardening now includes a Keep a Changelog file, release validation scripts, and a tag-driven GitHub Actions release workflow.
2627
- CLI no-argument and help-flag behavior now shows a real quick-start guide for npm and npx users.
2728
- Additional implemented rules now cover `pull_request_target` workflows and wildcard CORS in JSON config.

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,22 @@ npm install -g security-first-aid
102102
sfa scan . --format terminal
103103
```
104104

105-
Global npm installs now print a short quick-start message after installation.
105+
Recommended first run after install:
106+
107+
```bash
108+
npm install -g security-first-aid@latest
109+
sfa
110+
```
111+
112+
Then run one of these:
113+
114+
```bash
115+
sfa scan . --format terminal
116+
sfa rules list --format json
117+
sfa baseline create . --output ./.sfa-baseline.json
118+
```
119+
120+
Important: npm may not always show lifecycle output clearly during `npm install -g`, depending on the user's npm configuration. The reliable built-in guide is `sfa` or `sfa --help`.
106121

107122
If you just want the built-in guide:
108123

@@ -145,13 +160,20 @@ node ./src/cli/index.js rules list --format json
145160
### Option 1: Install from npm
146161

147162
```bash
148-
npm install -g security-first-aid
163+
npm install -g security-first-aid@latest
149164
```
150165

151-
Then run:
166+
Then immediately run:
167+
168+
```bash
169+
sfa
170+
```
171+
172+
Then choose a command:
152173

153174
```bash
154175
sfa scan . --format terminal
176+
sfa rules list --format json
155177
```
156178

157179
### Option 2: Run with npx

docs/reference/cli.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ sfa
1616

1717
If you run `sfa` with no arguments, the CLI now prints a built-in quick-start guide instead of a minimal usage block.
1818

19-
If you install the package globally from npm, the installer also prints a short post-install quick-start message.
19+
If you install the package globally from npm, use this as the first-run path:
20+
21+
```bash
22+
npm install -g security-first-aid@latest
23+
sfa
24+
```
25+
26+
The `sfa` command is the reliable built-in guide. npm may suppress or reduce post-install script output depending on install mode and client configuration.
2027

2128
PowerShell note:
2229

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Intentionally committed insecure fixture for rule coverage.
2+
SECRET_KEY=super-secret-value

0 commit comments

Comments
 (0)