Skip to content

Commit

Permalink
Ignore branch when creating a version anchor (#5263)
Browse files Browse the repository at this point in the history
We currently insist that you're on `main` when creating an anchor, to
avoid anchors being created that result in identical build numbers being
applied to different commits. However, this doesn't really apply now
that we have release branches with their own build sequence, so we need
to relax this restriction. This change just removes the superfluous
check.
  • Loading branch information
jmcphers authored Nov 4, 2024
1 parent fd20f7d commit e842d83
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions versions/create-anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ if (fs.existsSync(anchorPath)) {
return 0;
}

const branch = child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
if (branch !== 'main') {
console.error(`Commit anchors can only be created on the main branch. You're on '${branch}'.`);
return 1;
}

// Create the anchor file with the commit hash at the head of the current branch
const commit = child_process.execSync('git rev-parse HEAD').toString().trim();
fs.writeFileSync(anchorPath, commit);
Expand Down

0 comments on commit e842d83

Please sign in to comment.