Docs/Connectors

GitHub

Issues and pull requests as records, and their timelines, comments and reviews as episodes. Source code is never read.

The github connector reads issues and pull requests from the repositories you list. It reads their metadata, discussion and review history, and never reads source code or diffs.

Connector name github
Products Records, episodes
Credentials A fine-grained personal access token, or a classic token with repo scope
Permissions Read access to Issues, Pull requests and Metadata on each repository

What it pulls

Records. One record per issue (issue) or pull request (pull_request) updated in the window: repository, ID, title, body, state and state reason, who opened it, assignee, labels, milestone, comment count, created, updated, closed and merged times, draft flag and the author's association with the repository.

Episodes. For each issue or pull request, in order:

  • its creation, with its initial state and labels
  • timeline events: closed, reopened, merged, labeled, unlabeled, assigned, unassigned, review requested, renamed, milestoned, marked ready for review, converted to draft
  • comments, with author and time
  • for pull requests, submitted reviews with their outcome (approved, changes requested, commented) and body

GitHub logins become tokens. Titles, bodies, comments and review text are free text and are redacted. Code pasted into issue bodies or comments is still free text, so check the report's secrets list after the first run.

Credentials

  1. In GitHub, go to Settings → Developer settings → Personal access tokens → Fine-grained tokens and create a token.
  2. Limit it to the repositories you want to share.
  3. Under Repository permissions, grant read-only access to Issues, Pull requests and Metadata.
  4. Give the SDK the token and the list of repos.

A classic token with the repo scope also works, but it can read every repository its owner can, so prefer a fine-grained token. For GitHub Enterprise Server, set baseUrl to https://<host>/api/v3.

Connect

bash
datayield connect github -o repos=acme/api,acme/web -o token=env:GITHUB_READ_TOKEN

Secret options passed directly are saved to ~/.datayield/credentials. Values written as env:NAME are read from the environment at run time, which suits CI. See CLI reference.

Options

Option Required Meaning
token yes Stored as a secret
repos yes Repositories as owner/name, such as acme/api,acme/web
baseUrl no Defaults to https://api.github.com

datayield connect github checks the token and then checks that each repository is visible to it.

New records on each run

Each repository's issues and pull requests are listed with since set to the last successful run and kept when their update time falls in the window. A pull request that is updated again later is sent again, and its episode is rebuilt from the full timeline.