Skip to content

Commit efd1e3f

Browse files
committed
chore: always read branch name
1 parent 6f29731 commit efd1e3f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
# continue-on-error: true
106106
env:
107107
GITHUB_TOKEN: ${{ secrets.AUTO_RELEASE_GH_TOKEN }}
108+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
108109
run: pnpm release
109110

110111
- name: Check published prerelease

scripts/publish-to-npm.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import packageJson from '../package.json' assert { type: 'json' }
1212
const CANARY_NPM_TAG = 'canary'
1313

1414
const version = getVersion(packageJson)
15-
const branch = exec('git branch --show-current', { stdio: 'pipe' })[0].trim()
15+
const branch =
16+
exec('git branch --show-current', { stdio: 'pipe' })[0].trim() ||
17+
process.env.BRANCH_NAME
1618
console.log('Current branch:', branch)
1719

1820
await setVersions({ version })

0 commit comments

Comments
 (0)