Skip to content

Commit

Permalink
fix: be more inclusive in cli monitored projects inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlaud committed May 7, 2024
1 parent 415652f commit e3a540e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/snyk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ export const retrieveMonitoredReposBySourceType = async (
let targets = targetsResponse.data.data as TargetType[];

if (SourceType[sourceType] === 'cli' && scmHostname) {
targets = targets.filter(
(target: TargetType) =>
target.attributes.remoteUrl &&
target.attributes.remoteUrl.includes(scmHostname),
);
targets = targets.filter((target: TargetType) => {
return (
(target.attributes.remoteUrl &&
target.attributes.remoteUrl.includes(scmHostname)) ||
!target.attributes.remoteUrl?.startsWith('http')
);
});
}
const targetDisplayNames = targets.map(
(target) => target.attributes.displayName,
Expand Down

0 comments on commit e3a540e

Please sign in to comment.