diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b4427ec34..620e75a45 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -297,6 +297,7 @@ jobs: - name: Sync release files to title version env: + RELEASE_BASE: ${{ github.event.pull_request.base.ref }} VERSION: ${{ steps.title-version.outputs.version }} PREVIOUS_VERSION: ${{ steps.title-version.outputs.previous_version }} TITLE: ${{ steps.title-version.outputs.title }} @@ -304,7 +305,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - node .release-scripts/release-metadata.js sync-files "$VERSION" "$PREVIOUS_VERSION" + node .release-scripts/release-metadata.js sync-files "$RELEASE_BASE" "$VERSION" "$PREVIOUS_VERSION" git add package.json packages/*/package.json if [ -f CHANGELOG.md ]; then git add CHANGELOG.md diff --git a/scripts/test-release-automation.js b/scripts/test-release-automation.js index 49259a74d..155f878ca 100644 --- a/scripts/test-release-automation.js +++ b/scripts/test-release-automation.js @@ -1078,6 +1078,14 @@ test('no version bump needed: creates explicit release commit, no gh calls', () test('release title sync no-op exits without an empty commit', () => { const workflow = fs.readFileSync(path.join(ROOT_DIR, '.github', 'workflows', 'create-release-pr.yml'), 'utf8'); const syncStep = workflow.slice(workflow.indexOf(' - name: Sync release files to title version')); + assert.ok( + syncStep.includes('RELEASE_BASE: ${{ github.event.pull_request.base.ref }}'), + 'Expected sync-title step to expose the release base branch', + ); + assert.ok( + syncStep.includes('node .release-scripts/release-metadata.js sync-files "$RELEASE_BASE" "$VERSION" "$PREVIOUS_VERSION"'), + 'Expected sync-title step to call sync-files with base, version, and previous version', + ); assert.ok( syncStep.includes('echo "Release files already match v${VERSION}"\n exit 0'), 'Expected sync-title no-op path to exit cleanly',