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 ¶
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 ¶
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 ¶
Connect returns the host half. The provider holds no token, so the one it is handed is ignored.
func (Adapter) CredentialName ¶
CredentialName is empty: the provider acts through the forge as the person.
func (Adapter) DeployStep ¶
DeployStep hands the unpacked ./site to Pages and deploys it.
func (Adapter) HostConfig ¶
HostConfig: the provider reads no configuration file.
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. |