githubpages

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package githubpages is the hosting provider that publishes a project's site on its own GitHub Pages (itd-2610091010348892): the project's release workflow builds the about page and development record at each release, and GitHub hosts them at owner.github.io/<repo>/, or at a custom domain.

The repository half holds no secret. The deploy job runs in the `github-pages` environment with the run's own short-lived token and three permissions (contents: read, pages: write, id-token: write), and deploys the rendered site through actions/upload-pages-artifact and actions/deploy-pages, each pinned to a full commit. There is no host configuration file, and GitHub Pages serves no response header a site declares: a `_headers` file would be served as a plain file and protect nothing. So the project build writes none, and each page carries its content policy in its own head (internal/core/site's project_policy.go, iss-2610142036270003). The framing refusal and `nosniff` have no in-page form, and a Pages site goes without them.

The host half speaks the GitHub REST API through the forge, as the person who invoked the verb — the way the site setup's forge stage does, so abcd holds no GitHub token and resolves no credential:

GET  repos/{owner}/{repo}         is it public, and has it a Pages site
GET  repos/{owner}/{repo}/pages   the site's source, domain and address
POST repos/{owner}/{repo}/pages   create the site, built by a workflow
PUT  repos/{owner}/{repo}/pages   route a custom domain to it

These calls are written against GitHub's published REST reference and are exercised in this repository only against githubpagestest's in-process fake.

Public repositories only, for now: Pages on a private repository is access-controlled only on GitHub's enterprise plan, so a private repository is refused rather than published.

Index

Constants

View Source
const Environment = "github-pages"

Environment is the forge environment GitHub Pages deploys through.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API func(ctx context.Context, method, path string, body []byte) ([]byte, error)

API makes one GitHub REST call through the forge, as the person who invoked the verb: method, a repo-relative API path ("repos/acme/widgets/pages") and a JSON body or nil. A non-2xx answer is an error naming its HTTP status.

type Adapter

type Adapter struct {
	API API
}

Adapter is the github-pages provider. API is the forge; nil reaches nothing.

func (Adapter) Connect

func (a Adapter) Connect(string) hosting.Provider

Connect returns the host half. The provider holds no token, so the one it is handed is ignored.

func (Adapter) CredentialName

func (Adapter) CredentialName() string

CredentialName is empty: the provider acts through the forge as the person.

func (Adapter) DeployStep

func (Adapter) DeployStep() string

DeployStep hands the unpacked ./site to Pages and deploys it.

func (Adapter) HostConfig

func (Adapter) HostConfig(hosting.Site) (string, []byte)

HostConfig: the provider reads no configuration file.

func (Adapter) Name

func (Adapter) Name() string

Name is the manifest key.

func (Adapter) Profile

func (Adapter) Profile(s hosting.Site) hosting.Profile

Profile: the `github-pages` environment, the run's token with Pages and OIDC rights, the switch, public repositories only, a project site built from what abcd writes, and the project path GitHub serves the site below.

func (Adapter) Secrets

func (Adapter) Secrets() []string

Secrets: none. The deploy job uses the run's own token.

Directories

Path Synopsis
Package githubpagestest is an in-process fake of the slice of the GitHub REST API the github-pages hosting adapter calls, for tests only.
Package githubpagestest is an in-process fake of the slice of the GitHub REST API the github-pages hosting adapter calls, for tests only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL