Skip to content

@usine/core/repository

CommitSha = typeof CommitSha.Type

An exact Git commit recorded for a checkout or produced by an Attempt, unchanged when branch names move.


RepositoryName = typeof RepositoryName.Type

Full owner/name of a GitHub repository, in the casing the operator wrote. Compare through canonicalRepositoryName, since GitHub ignores case.


RepositoryRevision = typeof RepositoryRevision.Type

The branch, tag, commit, or HEAD a Worker fetches when preparing an Attempt; named refs resolve at preparation time.

const canonicalRepositoryName: (repository) => string

Lowercases a repository name for comparison, since GitHub ignores case.

Parameter Type
repository RepositoryName

string


const CommitSha: Schema.brand<Schema.String, "CommitSha">

An exact Git commit recorded for a checkout or produced by an Attempt, unchanged when branch names move.


const RepositoryName: Schema.brand<Schema.String, "RepositoryName">

Full owner/name of a GitHub repository, in the casing the operator wrote. Compare through canonicalRepositoryName, since GitHub ignores case.


const RepositoryRevision: Schema.brand<Schema.String, "RepositoryRevision">

The branch, tag, commit, or HEAD a Worker fetches when preparing an Attempt; named refs resolve at preparation time.


const safeSegment: (value) => string

Renders an identity as one path or ref segment: every character outside [A-Za-z0-9_.-] becomes _.

Parameter Type
value string

string


const splitRepositoryName: (repository) => object

Splits a repository name into its owner and name.

Parameter Type
repository RepositoryName

object

readonly name: string

readonly owner: string