From f12aad134f5a0804293bb53f1440827602f3d781 Mon Sep 17 00:00:00 2001 From: Jill Regan Date: Tue, 1 Dec 2026 19:41:07 -0500 Subject: [PATCH] Require full SHA match for /ok-to-test fork gate --- .github/workflows/ok-to-test.yml | 2 +- .github/workflows/validate.yml | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ok-to-test.yml b/.github/workflows/ok-to-test.yml index 3d7f1553..a9c35c83 100644 --- a/.github/workflows/ok-to-test.yml +++ b/.github/workflows/ok-to-test.yml @@ -1,4 +1,4 @@ -# If someone with write access comments "/ok-to-test" on a pull request, emit a repository_dispatch event +# If someone with write access comments "/ok-to-test sha=" on a pull request, emit a repository_dispatch event name: Ok To Test on: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f079a7e1..086de5f5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -89,10 +89,7 @@ jobs: if: | github.event_name == 'repository_dispatch' && github.event.client_payload.slash_command.args.named.sha != '' && - contains( - github.event.client_payload.pull_request.head.sha, - github.event.client_payload.slash_command.args.named.sha - ) + github.event.client_payload.slash_command.args.named.sha == github.event.client_payload.pull_request.head.sha steps: # Check out merge commit @@ -104,7 +101,7 @@ jobs: - name: Fork based /ok-to-test checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: - ref: ${{ github.event.client_payload.pull_request.head.sha }} + ref: ${{ github.event.client_payload.slash_command.args.named.sha }} - name: Set up Python uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4.9.1 @@ -135,7 +132,7 @@ jobs: if: ${{ always() }} env: job: ${{ github.job }} - ref: ${{ github.event.client_payload.pull_request.head.sha }} + ref: ${{ github.event.client_payload.slash_command.args.named.sha }} # Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run conclusion: ${{ job.status }} with: