From 7c8aada2bbe1f8c0fbfaf80b1630284d4fc3d468 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 20 Oct 2026 13:27:45 +0200 Subject: [PATCH] ci: read the /updatesqlx EE pin from the PR branch Co-Authored-By: Claude Opus 5.5 --- .github/workflows/claude.yml | 1 + .github/workflows/git-commands.yaml | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 2df9c062a6..f4238d89fe 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -29,6 +29,7 @@ jobs: # every secret its job references (a skipped step's included) in process memory. EE is # therefore checked out only in a separate job, and only for PRs whose head branch # lives in this repo; forks, issues and token-less runs take the job without it. + # Comments on a same-repo PR still reach the EE job; that exposure remains. pr-info: needs: [check-access] if: | diff --git a/.github/workflows/git-commands.yaml b/.github/workflows/git-commands.yaml index a8eaef8e4d..19c4b04d2f 100644 --- a/.github/workflows/git-commands.yaml +++ b/.github/workflows/git-commands.yaml @@ -69,11 +69,16 @@ jobs: ref: ${{ github.event.issue.pull_request.head.ref }} fetch-depth: 0 + # issue_comment payloads carry no PR head, so the checkout above is the default + # branch; read the pin from the PR branch itself. - name: Read EE ref id: ee + env: + GH_TOKEN: ${{ steps.app.outputs.token }} run: | - if [ -f backend/ee-repo-ref.txt ]; then - echo "ref=$(tr -d '[:space:]' < backend/ee-repo-ref.txt)" >> "$GITHUB_OUTPUT" + BRANCH=$(gh pr view ${{ github.event.issue.number }} --json headRefName --jq .headRefName) + if REF=$(git show "origin/$BRANCH:backend/ee-repo-ref.txt" 2>/dev/null); then + echo "ref=$(tr -d '[:space:]' <<<"$REF")" >> "$GITHUB_OUTPUT" else echo "Warning: ee-repo-ref.txt not found, using default branch" fi