fake_github_app: A fake GitHub web app

View source: R/fake-github-app.R

fake_github_appR Documentation

A fake GitHub web app

Description

A webfakes::new_app() application that implements the subset of the GitHub REST API needed by the gh test suite. It is exported so that downstream packages that depend on gh can use it to test their own GitHub-backed code without hitting the real API.

Usage

fake_github_app()

Details

The app accepts any token whose shape is a valid GitHub PAT (40 hex characters or a ghp_ / github_pat_ / ghs_ / ghr_ / gho_ / ghu_ prefix). Any other non-empty token is rejected with a 401 "Bad credentials". A missing Authorization header yields a 401 "Requires authentication" for endpoints that need a user.

Value

A webfakes_app object.

Examples


app <- fake_github_app()
proc <- webfakes::new_app_process(app)
proc$url()
proc$stop()


gh documentation built on May 29, 2026, 5:07 p.m.