Skip to content

Commit 127ca3a

Browse files
pattonwebzclaude
andcommitted
Build from the base branch, not just target it
CodeRabbit caught this on the multisite PR and it applies identically here: `base` only set the PR target, while actions/checkout took no ref at all. Since create-pull-request commits onto whatever HEAD it finds, dispatching from feature/foo with base develop would build feature/foo and then raise a PR into develop containing every commit between the two - not just the POT change. Checkout now uses the same `base` expression, so one value decides what gets built, what the PR branch is named, and what it targets. There is no combination of inputs that makes them disagree. The develop default is dropped from the input at the same time: with base now driving the checkout, a hardcoded default would silently ignore the branch picked in the dispatch UI. Empty falls back to the dispatched branch, so the picker behaves as expected and build and target still match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
1 parent 7954422 commit 127ca3a

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/make-pot.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
workflow_dispatch:
55
inputs:
66
base:
7-
description: 'Base branch to compare and create PR against.'
7+
description: 'Base branch to build from and create the PR against. Leave empty to use the branch this was dispatched on.'
88
required: false
9-
default: 'develop'
109

1110
# Manual dispatch only - deliberately no push or pull_request trigger, so this
1211
# never fires off a branch or a PR. That is also why there is no branch gating
@@ -16,8 +15,15 @@ jobs:
1615
make-pot:
1716
runs-on: ubuntu-latest
1817
steps:
18+
# Checked out at `base`, not just PR'd against it. create-pull-request
19+
# commits onto whatever HEAD it finds, so if this built one branch and
20+
# targeted another, every commit between the two would be swept into the
21+
# translation PR. Empty input falls back to the dispatched branch, which
22+
# keeps build and target the same by default.
1923
- name: Checkout code
2024
uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.event.inputs.base || github.ref_name }}
2127

2228
- name: Set up Node.js
2329
uses: actions/setup-node@v4
@@ -103,6 +109,6 @@ jobs:
103109
commit-message: Update POT translation file
104110
title: Update POT translation file
105111
body: This PR updates the POT translation file generated by the workflow.
106-
branch: update-translations/${{ github.ref_name }}
112+
branch: update-translations/${{ github.event.inputs.base || github.ref_name }}
107113
base: ${{ github.event.inputs.base || github.ref_name }}
108114
delete-branch: true

0 commit comments

Comments
 (0)