Commit a8471de
fix: replace anchore/scan-action with manual grype install to fix stale DB
Root cause: anchore/scan-action@v4 internally uses actions/cache to restore
the Grype vulnerability DB. This cache restore happens *inside* the action,
after our "Clear stale Grype DB cache" step had already run. As a result, the
stale DB (built >5 days ago) was always restored before grype executed, causing:
db could not be loaded: the vulnerability database was built 1 week ago
(max allowed age is 5 days)
With no DB available, grype produced no SARIF output, which then caused a
second failure at the upload step:
Invalid SARIF. JSON syntax error: Unexpected end of JSON input
Fix: drop anchore/scan-action@v4 entirely and replace with three explicit steps:
1. Install grype via the official install script
2. Run `grype db update` to force a fresh DB download (no cache involved)
3. Run grype manually, writing SARIF directly to grype-results.sarif
This also eliminates the now-unnecessary "Move Grype results" step, which only
existed to rename the action's hardcoded output filename.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5d04bd7 commit a8471de
1 file changed
Lines changed: 7 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 187 | + | |
194 | 188 | | |
195 | | - | |
| 189 | + | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 193 | + | |
| 194 | + | |
205 | 195 | | |
206 | 196 | | |
207 | 197 | | |
| |||
0 commit comments