Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/scripts/process-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function getBranch(repoUrl) {

// Function to get repository information (last commit date and stars)
function getRepoInfo(repoPath, branch = 'main') {
// Validate branch name to prevent command injection via shell metacharacters
if (!/^[a-zA-Z0-9/_.\-]+$/.test(branch)) {
console.error(`Skipping repo info: invalid branch name "${branch}"`);
return { lastCommitDate: null, stars: 0, forks: 0 };
}
const info = {
lastCommitDate: null,
stars: 0,
Expand Down