ensure scope filtering is backward compatible with enterprise rest api versions
This commit is contained in:
@@ -39,7 +39,9 @@ export function filterChangesByScopes(
|
||||
changes: Changes
|
||||
): Changes {
|
||||
const filteredChanges = changes.filter(change => {
|
||||
if (scopes.includes(change.scope)) {
|
||||
// if there is no scope on the change (GHES API for now), we will assume it is a runtime scope
|
||||
const scope = change.scope || 'runtime'
|
||||
if (scopes.includes(scope)) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ export const ChangeSchema = z.object({
|
||||
package_url: z.string(),
|
||||
license: z.string().nullable(),
|
||||
source_repository_url: z.string().nullable(),
|
||||
scope: z.enum(SCOPES),
|
||||
scope: z.enum(SCOPES).optional(),
|
||||
vulnerabilities: z
|
||||
.array(
|
||||
z.object({
|
||||
|
||||
Reference in New Issue
Block a user