Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 12 additions & 3 deletions .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
try {
const git = simpleGit();


const logOptions = {
from: branchB,
to: branchA,
Expand Down Expand Up @@ -132,10 +133,10 @@ function formatAsCSV(commitsByTeam) {
for (const [team, commits] of Object.entries(commitsByTeam)) {
commits.forEach((commit) => {
const row = [
escapeCSV(commit.message),
escapeCSV(commit.author),
stripDelimiter(commit.message, ','),
stripDelimiter(commit.author, ','),
commit.prLink,
escapeCSV(team),
stripDelimiter(team, ','),,
assignChangeType(commit.message),
];
csvContent.push(row.join(','));
Expand All @@ -146,6 +147,14 @@ function formatAsCSV(commitsByTeam) {
return csvContent;
}

// Helper function to strip delimiter from CSV fields so they can be properly imported automatically later
function stripDelimiter(inputString, delimiter) {
// Create a regex dynamically based on the provided delimiter
const regex = new RegExp(delimiter, 'g');
return inputString.replace(regex, '');
}


// Helper function to escape CSV fields
function escapeCSV(field) {
if (field.includes(',') || field.includes('"') || field.includes('\n')) {
Expand Down
27 changes: 27 additions & 0 deletions .github/scripts/update-release-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ function determineTemplateId(

// Function to parse a CSV file into a 2D array with specific modifications
function parseCSVv2(filePath) {

// List of authors to exclude
const excludedAuthors = ['github-actions[bot]', 'runway-github[bot]'];

// Regex patterns to exclude certain commit messages
// Regex patterns to exclude certain commit messages
const excludedCommitRegex = [
/cherry-pick/, // Matches any occurrence of "cherry-pick"
/cp-\d+\.\d+\.\d+/ // Matches patterns like "cp-1.0.0"
];

try {
console.log(`Parsing CSV file: ${filePath}`);

Expand Down Expand Up @@ -364,6 +375,22 @@ function parseCSVv2(filePath) {
columns[4], // Change Type
];

const commitMessage = modifiedColumns[0];
const author = modifiedColumns[1];

if (excludedAuthors.includes(author)) {
console.log(`Excluding commit by author: ${author}`);
continue; // Skip this commit
}

// Check if the commit message matches any excluded patterns
const isExcludedMessage = excludedCommitRegex.some(pattern => pattern.test(commitMessage));
if (isExcludedMessage) {
console.log(`Excluding commit due to message pattern: ${commitMessage}`);
continue; // Skip this commit
}


// Add this row to the 2D array
data2D.push(modifiedColumns);
}
Expand Down