diff --git a/.github/workflows/meta-import-risk.yml b/.github/workflows/meta-import-risk.yml index e043c3e1a4b..a17caed9a5e 100644 --- a/.github/workflows/meta-import-risk.yml +++ b/.github/workflows/meta-import-risk.yml @@ -22,7 +22,8 @@ jobs: - name: Checkout trusted base uses: actions/checkout@v6 with: - ref: ${{ github.event.pull_request.base.sha }} + # The PR payload's base.sha can predate the workflow and its helper scripts. + ref: ${{ github.event.pull_request.base.ref }} persist-credentials: false # Do this before the model job, including on the PR-opened event: the # meta-codesync label may not have arrived yet. @@ -69,12 +70,12 @@ jobs: risk: ${{ steps.assess.outputs.risk }} steps: # pull_request_target has access to the model secret even for fork PRs. - # Only the trusted base commit is checked out; PR code is read as data + # Only the current trusted base branch is checked out; PR code is read as data # through the GitHub API and is never executed on this runner. - name: Checkout trusted base uses: actions/checkout@v6 with: - ref: ${{ github.event.pull_request.base.sha }} + ref: ${{ github.event.pull_request.base.ref }} persist-credentials: false - name: Assess changed files and patch with Muse id: assess @@ -119,7 +120,7 @@ jobs: - name: Checkout trusted base uses: actions/checkout@v6 with: - ref: ${{ github.event.pull_request.base.sha }} + ref: ${{ github.event.pull_request.base.ref }} persist-credentials: false - name: Apply Meta Review Required when needed uses: actions/github-script@v8