Skip to content

Commit fdbbd00

Browse files
authored
Merge pull request #84 from crazy-max/scout-result
docker-scout: only write result files for file-based formats
2 parents e8a56fa + ebd557f commit fdbbd00

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

.github/actions/docker-scout/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717

1818
outputs:
1919
result-file:
20-
description: 'File output result'
20+
description: 'Path to result file (only if format is not packages)'
2121
value: ${{ steps.run.outputs.result-file }}
2222

2323
runs:
@@ -82,6 +82,10 @@ runs:
8282
8383
// TODO: cache binary
8484
85-
const resultPath = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'docker-scout-action-')), 'result.txt');
86-
core.setOutput('result-file', resultPath);
87-
await exec.exec('docker', ['scout', 'cves', inpImage, '--format', inpFormat, `--output`, resultPath]);
85+
const resultFile = path.join(fs.mkdtempSync(path.join(process.env.RUNNER_TEMP || os.tmpdir(), 'docker-scout-')), 'result.txt');
86+
const args = ['scout', 'cves', inpImage, '--format', inpFormat];
87+
if (inpFormat !== 'packages') {
88+
args.push('--output', resultFile);
89+
core.setOutput('result-file', resultFile);
90+
}
91+
await exec.exec('docker', args);

.github/workflows/.test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ jobs:
233233
format:
234234
- packages
235235
- sarif
236+
- sbom
237+
- spdx
236238
steps:
237239
-
238240
name: Checkout
@@ -251,7 +253,8 @@ jobs:
251253
image: registry://moby/buildkit:master
252254
format: ${{ matrix.format }}
253255
-
254-
name: Print result
256+
name: Check result file
257+
if: ${{ matrix.format != 'packages' }}
255258
run: |
256259
set -x
257260
cat ${{ steps.scout.outputs.result-file }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
image: alpine:latest
111111
-
112112
name: Upload SARIF report
113-
uses: github/codeql-action/upload-sarif@v3
113+
uses: github/codeql-action/upload-sarif@v4
114114
with:
115115
sarif_file: ${{ steps.scout.outputs.result-file }}
116116
```
@@ -137,7 +137,7 @@ jobs:
137137
steps:
138138
-
139139
name: Checkout
140-
uses: actions/checkout@v4
140+
uses: actions/checkout@v6
141141
-
142142
name: Test
143143
run: |
@@ -209,7 +209,7 @@ jobs:
209209
steps:
210210
-
211211
name: Checkout
212-
uses: actions/checkout@v4
212+
uses: actions/checkout@v6
213213
with:
214214
ref: ${{ matrix.commit }}
215215
```
@@ -271,7 +271,7 @@ jobs:
271271
steps:
272272
-
273273
name: Download
274-
uses: actions/download-artifact@v6
274+
uses: actions/download-artifact@v8
275275
with:
276276
name: buildx-releases-json
277277
path: .

0 commit comments

Comments
 (0)