Skip to content

Commit 7427ed0

Browse files
authored
chore: fix version bump script output (#47)
* chore: fix version bump script output * update CI script
1 parent 9a1f59b commit 7427ed0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/bump-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
jobs:
1111
bump-version:
1212
runs-on: ubuntu-latest
13+
if: github.ref == 'refs/heads/dev'
1314

1415
steps:
1516
- name: Checkout

scripts/bump-version.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ for (const file of packageFiles) {
4848
// do a string replace from oldVersion to newVersion
4949
const newContent = content.replace(`"version": "${oldVersion}"`, `"version": "${newVersion}"`);
5050
fs.writeFileSync(file, newContent);
51+
console.log(`Updated ${file}: ${oldVersion} -> ${newVersion}`);
5152
}
5253
}
5354

54-
console.log(`new_version=${newVersion}`);
55+
if (process.env.GITHUB_OUTPUT) {
56+
// CI output
57+
fs.appendFileSync(process.env.GITHUB_OUTPUT, `new_version=${newVersion}\n`);
58+
}

0 commit comments

Comments
 (0)