Skip to content

Commit 83cb5e6

Browse files
authored
fix: ensure tag script releases to the correct default branch (#1903)
1 parent 53d826f commit 83cb5e6

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ jobs:
6565
path: packages
6666

6767
- run: npm run test:ci
68-
- run: npm exec -- coveralls < .cache/coverage/lcov.info
69-
env:
70-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
7168

7269
deploy-staging:
7370
if: >

utils/scripts/tag.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,21 @@ const changelog = async (tag, spinner) => {
8383
/**
8484
* Push a GitHub release.
8585
*
86+
* @param {String} main Name for the main branch being released.
8687
* @param {String} tag The tag for the new release.
8788
* @param {String} markdown Markdown content.
8889
* @param {Ora} spinner Terminal spinner.
8990
*
9091
* @returns The draft release URL.
9192
*/
92-
const release = async (tag, markdown, spinner) => {
93+
const release = async (main, tag, markdown, spinner) => {
9394
info('Creating release...', spinner);
9495

9596
const pushArgs = ['push', '--follow-tags', '--no-verify', '--atomic', 'origin'];
9697

9798
// Ensure `version` commit hits CI, triggering npm publish
98-
await execa('git', pushArgs.concat('HEAD^:main'));
99-
await execa('git', pushArgs.concat('main'));
99+
await execa('git', pushArgs.concat(`HEAD^:${main}`));
100+
await execa('git', pushArgs.concat(main));
100101

101102
const url = await githubRelease({ tag, body: markdown, spinner });
102103

@@ -221,7 +222,7 @@ program
221222
]);
222223

223224
if (prompt.release) {
224-
await release(tag, markdown, spinner);
225+
await release(program.opts().main, tag, markdown, spinner);
225226
} else {
226227
await rollback(tag, spinner);
227228
}

0 commit comments

Comments
 (0)