Skip to content

Commit

Permalink
Merge pull request #91 from snyk-tech-services/fix/make-cli-monitored…
Browse files Browse the repository at this point in the history
…-repos-more-forgiving

fix: be more inclusive in cli monitored projects inclusion
  • Loading branch information
aarlaud authored May 7, 2024
2 parents 415652f + e3a540e commit 35d6354
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 35d6354

Please sign in to comment.