diff --git a/.github/workflows/staging-promotion-metadata.yml b/.github/workflows/staging-promotion-metadata.yml index 63591d83..76b8326b 100644 --- a/.github/workflows/staging-promotion-metadata.yml +++ b/.github/workflows/staging-promotion-metadata.yml @@ -31,10 +31,12 @@ jobs: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - name: Checkout base branch + - name: Checkout workflow source uses: actions/checkout@v6 with: - ref: ${{ github.event_name == 'workflow_dispatch' && 'main' || github.event.pull_request.base.ref }} + # For chained promotion PRs, the script lives on the trusted PR head, + # not necessarily on the older promotion branch used as the PR base. + ref: ${{ github.event_name == 'workflow_dispatch' && 'main' || github.event.pull_request.head.sha }} fetch-depth: 0 fetch-tags: true