The DIN check on a GitHub pull request
din alm pr-check writes what your DIN field's record says about a pull request onto the pull request itself, as one GitHub check run named DIN CTRL. It is the record, not the agent's account of its own work: every line carries the field's own grade or a person's stamp.
What the check does
1. It reads the pull request's commits from GitHub, and refuses (writing nothing) if the commit you name is not one of them. 2. It reads your field over its HTTPS API: the sessions of one project (by default the repository's name) captured from the day of the PR's earliest commit through the day of its newest. 3. It writes one check run on the commit. Running again on the same commit updates that check; it never adds a second one.
The check shows:
- the sessions, with their record ids, dates and regimes;
- the claims, each held (a checked state such as
tested, or a person'shuman_verified), refuted (refuted,contradicted, or a person'shuman_refuted) or ungraded (nothing checked it either way), with the grade the field holds for it: its state, regime and confidence; - the grader ids that graded those records, and whether they are mixed;
- a link to the field.
The conclusion is neutral: DIN informs and never blocks a merge. Add --fail-on-refuted to conclude failure when a claim is refuted. A field that cannot be read gives a neutral check that says so.
How a PR is matched to records. DIN records do not name a commit yet. The check matches by project and by the PR's commit window, and says so on the check: a session in that project and window is listed whether or not it made these commits. Use --project when the field files the work under another name.
It calls no model and sends nothing to DIN. It reads your field and writes to GitHub, and nothing else.
What it needs
- A reachable field. The runner must reach your field at an
https://address (http://is accepted on the same machine only). - The field's token, as a repository secret named
DIN_FIELD_TOKEN. The token is read from the environment only, never from the command line. - The field's address, as a repository variable named
DIN_FIELD_URL. - A runner with DIN on a paid plan. The check is the paid feature
alm_writeback.din licenselists it; on the free plan the command refuses and names it. The sample workflow runs on a self-hosted runner labelleddin, wheredinis installed and activated. checks: writefor the job'sGITHUB_TOKEN, which the sample workflow sets. A pull request from a fork gets a read-only token and no secrets, so it gets no check.
Set it up
Copy integrations/github/din-pr-check.yml into your repository as .github/workflows/din-pr-check.yml, then add the secret and the variable:
gh secret set DIN_FIELD_TOKEN
gh variable set DIN_FIELD_URL --body https://field.example.com
The workflow runs this on every push to a pull request:
din alm pr-check --repo "$REPO" --pr "$PR" --sha "$SHA" --field "$DIN_FIELD_URL"
To see the check without writing it, run the same command with --dry-run on a machine with GITHUB_TOKEN and DIN_FIELD_TOKEN set: it prints the summary and writes nothing.
Exit codes: 0 the check was written, 1 a read or the write failed, 2 refused (an argument, the plan, or a commit that is not the PR's).