mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
ci: correctly handle categories (#6943)
This commit is contained in:
3
.github/actions/trivy-triage/helpers.js
vendored
3
.github/actions/trivy-triage/helpers.js
vendored
@@ -5,7 +5,8 @@ module.exports = {
|
||||
const category = discussion.category.name;
|
||||
const body = discussion.body;
|
||||
if (category !== "Ideas") {
|
||||
consolt.log("skipping discussion with category ${category} and body ${body}");
|
||||
console.log(`skipping discussion with category ${category} and body ${body}`);
|
||||
return [];
|
||||
}
|
||||
const scannerPattern = /### Scanner\n\n(.+)/;
|
||||
const scannerFound = body.match(scannerPattern);
|
||||
|
||||
10
.github/actions/trivy-triage/helpers.test.js
vendored
10
.github/actions/trivy-triage/helpers.test.js
vendored
@@ -73,5 +73,15 @@ describe('trivy-triage', async function() {
|
||||
assert(!labels.includes('FilesystemLabel'));
|
||||
assert(!labels.includes('MisconfigurationLabel'));
|
||||
});
|
||||
it('process only relevant categories', async function() {
|
||||
const discussion = {
|
||||
body: 'hello world',
|
||||
category: {
|
||||
name: 'Announcements'
|
||||
}
|
||||
};
|
||||
const labels = detectDiscussionLabels(discussion, configDiscussionLabels);
|
||||
assert(labels.length === 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user