diff --git a/.github/workflows/agent-pr-explore-sandbox.yml b/.github/workflows/agent-pr-explore-sandbox.yml index f990b15b2..310cccce7 100644 --- a/.github/workflows/agent-pr-explore-sandbox.yml +++ b/.github/workflows/agent-pr-explore-sandbox.yml @@ -28,11 +28,25 @@ jobs: timeout-minutes: 45 steps: - - name: Checkout trusted base scripts - uses: actions/checkout@v6.0.2 - with: - ref: ${{ github.event.pull_request.base.sha || github.sha }} - persist-credentials: false + - name: Fetch trusted base script + # Only the self-contained sandbox script is needed on the trusted host; + # PR code is checked out inside Docker. A full actions/checkout of this + # large repo stalled on the self-hosted runner before the agent ever + # ran, so fetch just the one trusted file via the API instead. The ref + # is pinned to the trusted base/dispatch commit, never PR head. + shell: bash + env: + GH_TOKEN: ${{ github.token }} + TRUSTED_REF: ${{ github.event.pull_request.base.sha || github.sha }} + run: | + set -euo pipefail + mkdir -p .github/scripts + gh api \ + -H 'Accept: application/vnd.github.raw' \ + "repos/$GITHUB_REPOSITORY/contents/.github/scripts/agent-pr-explore-sandbox.sh?ref=$TRUSTED_REF" \ + > .github/scripts/agent-pr-explore-sandbox.sh + chmod +x .github/scripts/agent-pr-explore-sandbox.sh + echo "Fetched trusted agent-pr-explore-sandbox.sh at $TRUSTED_REF" - name: Resolve PR metadata id: pr