Skip to content

Commit

Permalink
feat: filter .github files
Browse files Browse the repository at this point in the history
  • Loading branch information
RostiMelk committed Dec 13, 2024
1 parent 27fa7e5 commit f011275
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@sanity/cli/src/util/remoteTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ export async function downloadAndExtractRepo(
const pathSegments = posixPath.split(posix.sep)
rootPath = pathSegments.length ? pathSegments[0] : null
}
// Exclude files in the .github directory to prevent potential security risks
// from running unknown actions if the repository is pushed to GitHub
if (posixPath.includes('/.github/')) {
return false
}
return posixPath.startsWith(`${rootPath}${filePath ? `/${filePath}/` : '/'}`)
},
}),
Expand Down

0 comments on commit f011275

Please sign in to comment.