package current_github

  1. Overview
  2. Docs

Module Current_github.ApiSource

Access to the GitHub API.

Sourcetype t

Configuration for accessing GitHub.

Sourceval webhook_secret : t -> string

Webhook secret to validate payloads from GitHub

Sourcetype refs

Reference information for the repository

Sourcemodule Status : sig ... end
Sourcemodule CheckRunStatus : sig ... end
Sourcemodule Commit : sig ... end
Sourcemodule CheckRun : sig ... end
Sourcemodule Repo : sig ... end
Sourcemodule Ref : sig ... end
Sourcemodule Ref_map : Map.S with type key = Ref.t
Sourceval of_oauth : token:string -> webhook_secret:string -> t

of_oauth ~token ~webhook_secret is a configuration that authenticates to GitHub using token.

Sourceval exec_graphql : ?variables:(string * Yojson.Safe.t) list -> t -> string -> Yojson.Safe.t Lwt.t

exec_graphql t query executes query on GitHub.

Sourceval head_commit : t -> Repo_id.t -> Commit.t Current.t

head_commit t repo evaluates to the commit at the head of the default branch in repo.

Sourceval head_of : t -> Repo_id.t -> Ref.id -> Commit.t Current.t

head_of t repo id evaluates to the commit at the head of id in repo. e.g. head_of t repo (`Ref "refs/heads/master")

Sourceval ci_refs : ?staleness:Duration.t -> t -> Repo_id.t -> Commit.t list Current.t

ci_refs t repo evaluates to the list of branches and open PRs in repo, excluding gh-pages.

  • parameter staleness

    If given, commits older than this are excluded. Note: the main branch commit is always included, even if stale.

refs t repo is the primitive for all the references in repo. This is the low-level API for getting the refs. It is used internally by ci_refs and head_of but in some cases you may want to use it directly, default_ref and all_refs will expose useful information for you. The result is cached (so calling it twice will return the same primitive).

Sourceval default_ref : refs -> string

default_ref refs will return the full name of the repository's default branch ref

Sourceval all_refs : refs -> Commit.t Ref_map.t

all_refs refs will return a map of all the repository's refs

Sourcemodule type GRAPHQL_QUERY = sig ... end

A GraphQL query to be monitored for changes

Sourcemodule Monitor (Query : GRAPHQL_QUERY) : sig ... end

Monitor a GraphQL query for changes on webhooks.

Sourcemodule Anonymous : sig ... end

Perform Anonymous request to GitHub.

Sourceval cmdliner : t Cmdliner.Term.t

Command-line options to generate a GitHub configuration.

Sourceval cmdliner_opt : t option Cmdliner.Term.t

Like cmdliner, but the argument is optional.

OCaml

Innovation. Community. Security.