diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 234d5bb..325669b 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -11,6 +11,7 @@ jobs: version: name: Version runs-on: ubuntu-latest + if: github.ref_name == 'main' steps: - name: Checkout uses: actions/checkout@v4 @@ -36,6 +37,7 @@ jobs: uses: peter-evans/create-pull-request@v6 with: branch: "gh-action-version" + base: main delete-branch: true title: "Update package versions" body: "Merging this PR will publish packages to npm at the new version." diff --git a/scripts/version.js b/scripts/version.js index 6609e9f..bc59296 100644 --- a/scripts/version.js +++ b/scripts/version.js @@ -26,8 +26,12 @@ pluginPackageJson.version = newVersion; standalonePackageJson.version = newVersion; await Promise.all([ - fs.writeFile(pluginPackageJsonPath, JSON.stringify(pluginPackageJson, null, 2), "utf-8"), - fs.writeFile(standalonePackageJsonPath, JSON.stringify(standalonePackageJson, null, 2), "utf-8"), + fs.writeFile(pluginPackageJsonPath, JSON.stringify(pluginPackageJson, null, 2) + "\n", "utf-8"), + fs.writeFile( + standalonePackageJsonPath, + JSON.stringify(standalonePackageJson, null, 2) + "\n", + "utf-8" + ), ]); await new Promise((resolve, reject) => { exec(