Skip to content

Commit 15c67db

Browse files
committed
fix(monorepo): use PR base branch as base_version dynamically
Instead of hardcoding base_version to 'develop', output the PR's base branch from the find-pr job and pass it to the deploy-npm workflow for accurate affected project detection.
1 parent 13b65bb commit 15c67db

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/deploy-beta.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
outputs:
4343
pr_number: ${{ steps.pr-info.outputs.pr_number }}
4444
pr_url: ${{ steps.pr-info.outputs.pr_url }}
45+
pr_base_branch: ${{ steps.pr-info.outputs.pr_base_branch }}
4546
force_deploy_mode: ${{ steps.check-force-deploy.outputs.force_deploy_mode }}
4647
steps:
4748
- name: Harden the runner (Audit all outbound calls)
@@ -100,6 +101,7 @@ jobs:
100101
101102
core.setOutput('pr_number', prNumber);
102103
core.setOutput('pr_url', prUrl);
104+
core.setOutput('pr_base_branch', pr.base.ref);
103105
} else {
104106
const allowedBranches = 'develop, main, hotfix/*, release/*, hotfix-release/*';
105107
core.setFailed(`No open PR found for branch ${branch} targeting an allowed base branch (${allowedBranches})`);
@@ -244,13 +246,13 @@ jobs:
244246
deploy-npm:
245247
name: Deploy to NPM
246248
uses: ./.github/workflows/deploy-npm.yml
247-
needs: get-deploy-inputs
249+
needs: [find-pr, get-deploy-inputs]
248250
if: ${{ inputs.deploy_to_npm }}
249251
with:
250252
environment: beta
251253
bugsnag_release_stage: beta
252254
version_suffix: ${{ needs.get-deploy-inputs.outputs.version_suffix }}
253-
base_version: develop
255+
base_version: ${{ needs.find-pr.outputs.pr_base_branch }}
254256
head_version: ${{ github.ref_name }}
255257
trigger_source: ${{ needs.get-deploy-inputs.outputs.trigger_source }}
256258
secrets:

0 commit comments

Comments
 (0)