diff --git a/.github/workflows/internal-tests.yml b/.github/workflows/internal-tests.yml index f9865175c0d..4b5dc80a9e6 100644 --- a/.github/workflows/internal-tests.yml +++ b/.github/workflows/internal-tests.yml @@ -21,11 +21,6 @@ jobs: if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }} runs-on: ubuntu-latest steps: - - name: Print current ref and sha - run: | - echo "github.ref=${{ github.ref }}" - echo "github.sha=${{ github.sha }}" - - name: Trigger and wait for Internal Tests uses: actions/github-script@v7 with: @@ -35,9 +30,15 @@ jobs: const targetRepo = 'SpacetimeDBPrivate'; const workflowId = 'internal-tests.yml'; const targetRef = 'master'; - const publicRef = context.sha; + // Use the ref for pull requests because the head sha is brittle (github does some extra dance where it merges in master). + const publicRef = (context.eventName === 'pull_request') ? context.payload.pull_request.head.ref : context.sha; const preDispatch = new Date().toISOString(); + console.log("context.eventName =", context.eventName); + console.log("context.ref =", context.ref); + console.log("context.sha =", context.sha); + console.log("Dispatch workflow with publicRef =", publicRef); + // Dispatch the workflow in the target repository await github.rest.actions.createWorkflowDispatch({ owner: targetOwner,