Skip to content

Commit ec90685

Browse files
committed
use artifact prefix to avoid conflicts
1 parent cb03b65 commit ec90685

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/integration-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
target: push
4646
sources: ${{ github.workspace }}
4747
debug: true
48+
artifact-prefix: ${{ matrix.os }}
4849
- name: Check run succeeded
4950
env:
5051
RUN_OUTPUT: ${{ steps.run-action.outputs.push-completed }}
@@ -58,7 +59,7 @@ jobs:
5859
- name: Download results
5960
uses: actions/download-artifact@v4
6061
with:
61-
name: ${{ runner.name }}-results-push
62+
name: ${{ matrix.os }}-results-push
6263
path: artifact
6364
- name: Check results
6465
working-directory: artifact

action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
description: 'Show vulnerabilities found in transitive dependencies'
2424
required: false
2525
default: false
26+
artifact-prefix:
27+
description: 'Prefix for the artifact name'
28+
required: false
29+
default: ''
2630
outputs:
2731
old-completed:
2832
description: 'If running a target called old, whether the analysis for this was completed'
@@ -92,3 +96,4 @@ runs:
9296
token: '${{ inputs.token || github.token }}'
9397
footer: '${{ inputs.footer }}'
9498
eval-indirect-dependencies: '${{ inputs.eval-indirect-dependencies }}'
99+
artifact-prefix: '${{ inputs.artifact-prefix }}'

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ async function runAnalysis() {
7676
toUpload.push(scaReport)
7777

7878
const uploadStart = Date.now()
79-
await uploadArtifact('results-' + target, ...toUpload)
79+
const artifactPrefix = getInput('artifact-prefix')
80+
if (artifactPrefix !== '') {
81+
await uploadArtifact(artifactPrefix + '-results-' + target, ...toUpload)
82+
} else {
83+
await uploadArtifact('results-' + target, ...toUpload)
84+
}
8085
telemetryCollector.addField('duration.upload-artifacts', (Date.now() - uploadStart).toString())
8186
setOutput(`${target}-completed`, true)
8287
}

0 commit comments

Comments
 (0)