mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
better artifact filters
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
f6cb65f5d7
commit
34b9533f22
23
.github/workflows/validations.yaml
vendored
23
.github/workflows/validations.yaml
vendored
@ -106,8 +106,14 @@ jobs:
|
||||
const dirs = ls(baseDir).filter(f => f.isDirectory()).map(f => f.name)
|
||||
const uploads = []
|
||||
|
||||
// filter to only amd64 and arm64 architectures
|
||||
const supportedArchs = ['amd64', 'arm64']
|
||||
const filteredDirs = dirs.filter(dir =>
|
||||
supportedArchs.some(arch => dir.includes(arch))
|
||||
)
|
||||
|
||||
// upload platform subdirectories
|
||||
for (const dir of dirs) {
|
||||
for (const dir of filteredDirs) {
|
||||
// uploadArtifact returns Promise<{id, size}>
|
||||
uploads.push(artifact.uploadArtifact(
|
||||
// name of the archive:
|
||||
@ -120,6 +126,21 @@ jobs:
|
||||
))
|
||||
}
|
||||
|
||||
// upload RPM and DEB packages for supported architectures
|
||||
const packageFiles = ls(baseDir).filter(f =>
|
||||
f.isFile() &&
|
||||
(f.name.endsWith('.deb') || f.name.endsWith('.rpm')) &&
|
||||
supportedArchs.some(arch => f.name.includes(`_${arch}.`))
|
||||
)
|
||||
for (const file of packageFiles) {
|
||||
uploads.push(artifact.uploadArtifact(
|
||||
file.name,
|
||||
[`${baseDir}/${file.name}`],
|
||||
baseDir,
|
||||
{ retentionDays: 30 }
|
||||
))
|
||||
}
|
||||
|
||||
// upload checksums file (needed by install tests)
|
||||
const rootFiles = ls(baseDir).filter(f => f.isFile() && f.name.match(/syft_.*_checksums\.txt$/))
|
||||
if (rootFiles.length > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user