Skip to main content

Build ref token mismatch

typehttps://docs.frem.sh/reference/api/errors/build-ref-token-mismatch
HTTP status400 Bad Request

What it means

You sent predicate.buildDefinition.externalParameters.ref, and it does not match the git ref your runner job token was issued for.

A runner job token already names its ref in signed claims, and fremforge signs that ref, the event and the workflow ref into internalParameters of the statement. A different ref from the caller would put two answers to one question into a signed statement, so the request is refused rather than one of them silently winning. The refusal is logged.

What to do

Omit ref from externalParameters. Read the ref a build ran on from internalParameters.ref, which fremforge takes from the token. If you need it in externalParameters, send exactly the token’s ref (for a push to main, refs/heads/main).

Response shape

All fremforge API errors are RFC 9457 problem+json:

{
  "type": "https://docs.frem.sh/reference/api/errors/build-ref-token-mismatch",
  "title": "Bad Request",
  "status": 400,
  "detail": "..."
}

Branch on type, not on title or detail - those are human-readable and may be reworded.