diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 88b371c1..d86b2ca6 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -10,6 +10,7 @@ permissions: jobs: bump-version: runs-on: ubuntu-latest + if: github.ref == 'refs/heads/dev' steps: - name: Checkout diff --git a/scripts/bump-version.ts b/scripts/bump-version.ts index 6538df32..ac42655d 100644 --- a/scripts/bump-version.ts +++ b/scripts/bump-version.ts @@ -48,7 +48,11 @@ for (const file of packageFiles) { // do a string replace from oldVersion to newVersion const newContent = content.replace(`"version": "${oldVersion}"`, `"version": "${newVersion}"`); fs.writeFileSync(file, newContent); + console.log(`Updated ${file}: ${oldVersion} -> ${newVersion}`); } } -console.log(`new_version=${newVersion}`); +if (process.env.GITHUB_OUTPUT) { + // CI output + fs.appendFileSync(process.env.GITHUB_OUTPUT, `new_version=${newVersion}\n`); +}