Skip to content

Commit e842d83

Browse files
authored
Ignore branch when creating a version anchor (#5263)
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.
1 parent fd20f7d commit e842d83

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

versions/create-anchor.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ if (fs.existsSync(anchorPath)) {
2626
return 0;
2727
}
2828

29-
const branch = child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
30-
if (branch !== 'main') {
31-
console.error(`Commit anchors can only be created on the main branch. You're on '${branch}'.`);
32-
return 1;
33-
}
34-
3529
// Create the anchor file with the commit hash at the head of the current branch
3630
const commit = child_process.execSync('git rev-parse HEAD').toString().trim();
3731
fs.writeFileSync(anchorPath, commit);

0 commit comments

Comments
 (0)