Skip to content

Commit 8b3ebe5

Browse files
committed
ci(publish): add even more logging
1 parent e81549a commit 8b3ebe5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/publish-to-npm.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import packageJson from '../package.json' assert { type: 'json' }
1313

1414
const version = getVersion(packageJson)
1515
const branch = exec('git branch --show-current', { stdio: 'pipe' })[0].trim()
16+
console.log('Current branch:', branch)
1617

1718
await setVersions({ version })
1819

1920
if (checkStatus() === 'clear') process.exit(0)
2021

21-
commitAndPush({ version })
22+
commitAndPush({ version, branch })
2223
publishToNPM({
2324
tag:
2425
branch === PRODUCTION_BRANCH
@@ -78,14 +79,14 @@ function getVersion(packageJson) {
7879
}
7980

8081
/**
81-
* @param {{ version: string }} params
82+
* @param {{ version: string, branch: string }} params
8283
*/
83-
function commitAndPush({ version }) {
84+
function commitAndPush({ version, branch }) {
8485
exec(`
8586
git config user.name 'Piotr Monwid-Olechnowicz'
8687
git config user.email '[email protected]'
8788
git commit -am "Bump versions to: ${version} [skip ci]"
88-
git push
89+
git push origin HEAD:${branch}
8990
`)
9091
}
9192

0 commit comments

Comments
 (0)