Skip to content
Draft
Changes from 1 commit
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
Next Next commit
fix(action): add several checks to make sure we find the release bran…
…ch or we are informed if we don't
  • Loading branch information
gauthierpetetin committed Aug 4, 2025
commit 843a9f59fb47ecf8779a9816d2e9107418a742b0
27 changes: 26 additions & 1 deletion .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,31 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
try {
const git = simpleGit();

// Fetch all branches and tags to ensure references exist
await git.fetch(['--all', '--tags', '--prune']);

// Check if branchA exists
let branchAExists = true;
try {
await git.revparse([branchA]);
} catch (e) {
branchAExists = false;
}

// Check if branchB exists
let branchBExists = true;
try {
await git.revparse([branchB]);
} catch (e) {
branchBExists = false;
}

if (!branchAExists || !branchBExists) {
throw new Error(
`Cannot find reference(s):${!branchAExists ? ` ${branchA}` : ''}${!branchBExists ? ` ${branchB}` : ''}.`
);
}

const logOptions = {
from: branchB,
to: branchA,
Expand Down Expand Up @@ -223,7 +248,7 @@ async function main() {
`Generating CSV file for commits between ${branchA} and ${branchB} on ${platform} platform...`,
);

const commitsByTeam = await filterCommitsByTeam(platform, branchA, branchB);
const commitsByTeam = await filterCommitsByTeam(platform, `origin/${branchA}`, `origin/${branchB}`);

if (Object.keys(commitsByTeam).length === 0) {
console.log('No commits found.');
Expand Down
Loading