Contents

GitHub

New to Workfile? Start with Getting started.

Each entry in providers.yml is one connection. Its name is the start of every
expression that uses it, and it is the name you give to wf setup --test.

The provider setting says which provider to use. If you leave it out, the
connection's name is used. Keep your real secrets in your environment or your
personal credentials file. Workfile refuses secrets written straight into
auth. A token can only read what its account is allowed to see.

github:
  org: example-team
  repos: [app, api]
  auth:
    token: ${EXAMPLE_GITHUB_TOKEN}

GitHub.com#

Use a classic GitHub personal access token with the repo and read:org
scopes. wf setup opens GitHub's new-token page with both already selected.
Workfile only reads, but classic tokens have no read-only choice for
repositories, so repo is the smallest scope that works. If your organisation
uses single sign-on, choose Configure SSO next to the token and authorise it.
Fine-grained tokens are not recommended. wf setup --test github checks the fields that Workfile reads.
These guides help:
GitHub's GraphQL guide
and token setup.

Setting What it means
org Required. Your GitHub organisation name.
repos Required. The repositories your team ships from, such as [app, api], or all.
auth.token The name of the credential that holds your GitHub token.

Scope#

repos says which repositories workfile reads PRs from.

  • repos: [app, api] reads only those two. A PR in any other repository is never linked, even when its title names a ticket.
  • repos: all reads every repository in the organisation that is not archived.
  • wf setup --test fails if a listed repository is archived or hidden from your
    token. It also fails if GitHub reports PRs but withholds the sampled PR.
  • You must write one or the other. There is no default that reads more than you chose.

Why explicit? Anyone reading providers.yml sees what workfile reads, and a
narrow list means fewer requests.

How PRs are found#

If the tracker supplies direct PR references, Workfile reads those PRs by
repository and number. Otherwise it searches GitHub across your organisation.

  • A PR title can contain the full ticket key, such as APP-42.
  • A PR description can contain an explicit ticket URL, such as
    https://example-team.atlassian.net/browse/APP-42 on your configured Jira
    site. Use a URL when the description is the only place that names the ticket.
  • A PR branch can start with the ticket key, such as APP-42-fix-login.
    Workfile searches branch prefixes when you name a ticket in wf status or
    wf check, or open its workflow in Tracker. Board-wide reads and Inbox polls
    search titles and bodies in batches of up to six ticket keys. Inbox also
    checks branch names on the PRs it already follows. Use a title key or ticket
    URL for links that should appear in board-wide reads.

Workfile searches text and branch prefixes in parallel for a named lookup.
It verifies the whole key on the returned PR, so APP-12 does not match
APP-123. It keeps open and merged PRs in configured, non-archived repositories
and reads review and CI details once per matched PR. A PR can link to several
tickets. Commit messages and Jira's development panel are outside this search.

PR attributes#

Attribute What it holds
github.prs How many PRs are linked to the ticket.
github.labels The label names on each PR.
github.approvals Reviewers whose latest opinion is an approval. Works with by.
github.fresh_approvals Those approvers whose review commit matches the PR's current head commit. Works with by.
github.draft Text true or false: whether the PR is a draft.
github.checks Current commit's combined check and status result: success, pending, failure, or none.
github.state open or merged. A queued PR is still open.
github.merge_queue queued when the PR has a merge queue entry; otherwise none. Missing membership is unknown.
github.author The login of the person who wrote the PR.
github.review_requests Requested user logins, or team:slug for a team request. Team membership is not guessed.
github.changes_requested Logins whose latest opinion requests changes.
github.mergeable mergeable or conflicting. GitHub's UNKNOWN stays unavailable.

Approvals count each reviewer once. If a reviewer's latest opinion asks for
changes or was dismissed, it is not an approval. A comment-only review does not
cancel an earlier approval. With by, the names must be people whose account
for this connection is their GitHub login.

Action inbox#

wf tracker reads conflicts and requested changes in the normal linked-PR
request, alongside CI and review requests. It adds no separate requests for
these fields. A direct checks link is supplied for c in the tracker.
When you open a ticket whose PR has failing checks, the tracker makes one more
request for that PR, to name the failing jobs and link to their logs.
Review requests are evidence of waiting, not approvals. An empty request list
and an unavailable request list are different. User and team requests are both
preserved, but a team request never implies that a particular member was asked.

Inbox activity#

wf tracker --view inbox polls only open PRs on work in flight, in two steps. One small
GraphQL query per 100 PRs asks only when each was last updated. Only PRs
updated since the last poll have their timeline read: the newest 50 comments,
reviews, review requests and commits since the last look. A poll where nothing changed is
one request, plus two searches that find open PRs you wrote or were asked to
review (author:@me, review-requested:@me), limited to the repos in scope.
Each reads one page of 50.

Merge queues#

A merge queue holds approved changes while GitHub checks whether they can merge
safely together. Workfile reads the linked PR's current queue membership. Queued
PRs show Queued for merge and Wait for merge, instead of an instruction to
merge them again. Failing gates or unreadable evidence remain visible, even when
GitHub has queued the PR.

Queue membership never counts as merged, an approval, or a passing check. Existing
github.state == merged rules still fail until GitHub reports the PR as merged.
You can explicitly require membership with github.merge_queue == queued.
Workfile does not enqueue, dequeue or merge anything. It reads membership, not
queue position or the checks on GitHub's temporary merge-group commit; checks
still describes the PR's current commit.

CI in the code review gate#

CI means continuous integration: automated checks run for a change. Require
GitHub's combined check/status result to pass on each PR's current commit:

gates:
  code_review:
    - if: github.approvals >= 1
    - if: github.checks == success

Both conditions must pass on every linked PR. Keep a separate
github.prs >= 1 rule before review if a PR must exist; per-PR rules are skipped
when there are none. GitHub's example policies now include the CI rule, but
Workfile does not silently add it to existing policies.

When CI is pending, Workfile says to wait for it to finish successfully. When
it fails, it says to fix and rerun the failing checks. With no reported checks,
it says to run CI for the current commit. Unavailable evidence remains unknown.

Readiness rules#

gates:
  release_ready:
    - id: linked-pr
      if: github.prs >= 1
    - id: ready-for-review
      if: github.draft == false
    - id: automated-checks
      if: github.checks == success
    - id: current-commit-reviewed
      if: github.fresh_approvals >= 1

checks uses GitHub's combined result for the latest commit, including check
runs and commit statuses. It is not limited to GitHub Actions. It does not check
which jobs your team expected to run, or reproduce branch protection. none
means GitHub returned no check result. It does not pass a success rule.
Pending checks are known evidence and fail a success rule until they finish.
Missing or unrecognised check data is unknown, not none or a pass.

Fresh approvals compare commit IDs, not dates. A new commit makes earlier
approvals stale even if they still count under approvals. If GitHub does not
provide the commits needed for the comparison, freshness is unknown. Draft
status is unknown when it was not returned. Unknown evidence on a required path
can make the ticket "cannot check" and exit with code 2. A known passing
alternative remains available. A provider request failure stops the report;
Workfile never treats a failed read as an empty list.

These rules are opt-in. GitHub's own merge restrictions still apply. Workfile
never merges a PR or moves a ticket.

Searches, labels, reviews and review requests all come in pages, and Workfile
reads every page. GitHub stops a search at 1,000 results. If one search hits
that limit, the command fails rather than show a partial result as if it were
healthy.

What your token can see always limits a report. A PR in an archived or hidden
repository is never linked. A passing token test cannot tell you about
repositories the token is not allowed to see.

Older providers.yml files may still have a lookback setting. It is no longer
used, and you can delete it.

GitHub Issues as a tracker#

GitHub can do two jobs: hold your tickets (a tracker), and hold the PRs that
change code (a code host). A team that uses it for both has two connections.
issues is the tracker. github is the code host.

issues:
  provider: github
  org: example-team
  project: 7
  repos: [app, api]
  keep_done_for: 14d
  skip_statuses: [Backlog]
  default_project: app
  statuses:
    todo: Backlog
    doing: In progress
    done: Done
  auth:
    token: ${EXAMPLE_GITHUB_TOKEN}
github:
  org: example-team
  repos: [app, api]
  auth:
    token: ${EXAMPLE_GITHUB_TOKEN}

To see a person's assigned tickets with --me or --user, people.yml needs
their login under the tracker's connection name, as well as under github:

alice:
  name: Alice
  issues: example-alice
  github: example-alice

Without the issues line, wf status --user alice silently misses the tickets
assigned to her.

In policy.yml, set tracker: issues. The keys under statuses must be stage
names from policy.yml. Two connections keep issues.labels
(labels on the issue) apart from github.labels (labels on the PR).

Setting What it means
org Required. Your GitHub organisation name.
project Required. The number of your organisation's GitHub Project, from its address.
repos Required. The repositories your team's issues are in, such as [app, api], or all.
keep_done_for Required. How long finished issues stay in scope, such as 14d or 2w.
statuses Required. Maps each stage in your policy to one or more Status names.
skip_statuses Optional. Status names to leave out, such as [Backlog].
scope Optional. Extra GitHub project filter text added on top, such as label:bug.
default_project Optional. A repository name in lower case, such as app. It lets you name an issue by number alone.

The view setting is no longer read. A saved project view is a setting on a
screen, not in your repo. Writing view is an error. Say what you mean with
repos, skip_statuses, keep_done_for and scope instead.

Scope#

Workfile reads the items of your project that match what you wrote:

You write Workfile asks GitHub for
repos: [app] repo:example-team/app
repos: [app], skip_statuses: [Backlog, "On hold"] repo:example-team/app -status:Backlog,"On hold"
repos: [app], scope: label:bug repo:example-team/app label:bug
repos: [app, api] or repos: all No repo: filter. Workfile drops other repositories itself.

Then, for every issue, workfile also checks that it is in a listed repo, is not in
a skipped status, and is open or was closed within keep_done_for. This is a
safety net. It means a loose filter never widens what you read.

scope is GitHub's own filter text, so write the status exactly, emoji included,
such as status:"🕰 Backlog". skip_statuses ignores leading symbols, like
statuses does.

Token#

Use a classic token with repo, read:org and read:project. Without
read:project GitHub refuses the read, and wf setup --test names the missing scope.

Status comes from the project#

A ticket's stage comes from the project's Status field, not from whether
the issue is open or closed. Boards often drift from the issue state, so the
board wins. The field name is fixed: it must be called Status. Only
organisation projects work. User projects do not.

Status names match without case and without leading symbols, so done: Done
matches a status called ☠️ Done. If an exact match exists, it wins. If two
stages would match, the status is left unmapped and reported as an error.

Archived items are left out of lists, but you can still look one up by key. An
issue that is not on the project is reported with an error.

Naming a ticket#

A ticket key is the repository, then the number, such as app#42. Keys are in
lower case. With default_project: app, both of these work:

wf status 42
wf status app#42

Do not write wf status #42 without quotes. In most shells an unquoted #42 is
a comment, so the command runs with no ticket. Write '#42' or leave off the #.

What it reads#

  • assignee is the first person assigned to the issue. Only the first counts.
    wf status --me and the wf tracker --view me screen see that person only. A second assignee does
    not see the ticket in those views, unless a PR involves them.
  • One run of a command pays for one paged read of the project.
  • At most 20 closing PRs per issue are read.
  • An issue whose only closing PR is in another organisation gets no records.
  • An issue from another organisation's repository can appear in a list of the
    board, but cannot be read by key.
  • project is the repository, and type is the issue type. Priority, size and
    other project fields are not facts. Label by rules are not supported.

A PR links to an issue when GitHub itself links them: for example Resolves #42 in the PR description, or a link made by hand in GitHub. Workfile reads
these links in the same query as the issue. PRs closed without merging are left
out. Open PRs and drafts are included.

When the issue has no direct references, the same search rules apply with the
full issue key, such as app#42, or the issue's URL. The repository name is
required for a key in a PR title or branch.

Issue text and images#

The wf tracker screen shows the issue's text and comments (wf status does not). Headings, paragraphs, emphasis,
code, links, lists, quotes, rules and tables are shown. Anything else stays as
plain text.

Only ![alt](address) images on GitHub's own hosts are shown. <img> tags stay
as text. An image address that redirects does not display. Workfile never sends
your token to another host.

When something goes wrong#

What you see What to try
Credential is not set Make sure the ${NAME} in auth matches an environment variable or a line in your credentials file, and that it is not empty.
GitHub project read refused Add the read:project scope to your token, and check that the project belongs to your organisation.
Credentials permission error On macOS or Linux, run chmod 600 on the file it names.
HTTP 401 Check the account, the token, and whether the token has expired.
HTTP 403 or GraphQL query rejected Check scopes, repository access, organisation rules, single sign-on, and rate limits.
Jira query rejected Try your JQL in Jira, and check the project and status names.
No Jira cloud ID Check site. Only Jira Cloud is supported.
Unmapped GitHub status Add the name to the right stage under statuses.
Unmapped Jira status Add it to the right stage under statuses, or list it under skip_statuses on purpose.
A PR you expected is missing Run wf status APP-42 to search branches too. Check that the PR matches a linking rule and that the token can read the configured repository.
A ticket you expected is missing Check your scope, your --me or --user filter, the limit, and your account's access.

Requests time out after 30 seconds. If a request is rate limited or the gateway
has a short failure, Workfile tries again up to two times, with short waits that
you can cancel. If the wait would be longer, it tells you, so you can try later.
Responses from the providers are never printed. That keeps error messages from
repeating credentials or private data.