Skip to main content

Module github

Module github 

Source
Expand description

Pure helpers for the GitHub sticky-comment protocol.

This module does not perform network IO — it produces the URLs, headers, and method/body pairs the CLI feeds to its HTTP client. Keeping the protocol pure makes it trivial to unit-test (no mocked HTTP) and easy to swap clients later.

The CLI binary wires this up to [ureq] (or anything else) in crates/aatxe/src/github_http.rs.

Structs§

DetectedContext
Resolve PR number and repo slug from common GH Actions / generic CI env vars. Returns None for fields not present so the caller can decide what to do (e.g. fall back to CLI flags).
GithubContext
PR context required to find / create / update the sticky comment.

Functions§

create_comment_url
URL for creating a new issue comment on a PR.
default_headers
Header pairs to send on every GH REST call. The token is revealed from its Secret wrapper only when the header value is constructed; the returned Authorization string is the only place the cleartext lives, and it is consumed by the HTTP client immediately.
detect_context
Read GH Actions / generic CI env to populate as much of GithubContext as possible. The caller mixes in CLI overrides.
list_comments_url
URL for listing comments on a PR (paged, 100 per page).
patch_comment_url
URL for updating an issue comment by id.
validate_sticky
Validate that a rendered comment body carries the sticky marker. Returns an Err without the marker so a caller can refuse to post a body that would create a new comment instead of updating the existing one.