Why does my workflow always run on `main` even though I set `ref`?
No, nothing is wrong on the Testomat.io side. This is how the GitHub Actions API works.
When a workflow_dispatch is triggered through the API, GitHub treats two things separately:
{ "ref": "your-branch", "inputs": { "run": "...", "grep": "..." }}refis GitHub’s own parameter, it decides which branch the workflow runs on.inputsare the user-defined values you declared in your workflow file.
Testomat.io sends ref correctly as a top-level parameter, so GitHub does start the workflow from your branch. But GitHub consumes ref before the workflow begins, and it never passes it into inputs. So if your workflow reads ${{ inputs.ref }}, it gets the default, because inputs.ref is a separate field that doesn’t exist unless you declare it yourself.
The fix
Section titled “The fix”To refer to the branch inside your workflow, use GitHub’s built-in context variable instead of an input:
${{ github.ref_name }}This always reflects the branch the workflow is actually running on, no matter how it was triggered.