Expand description
GitHub REST client for verctl pull requests, Releases, drafts, tags,
branch rules, and workflow runs.
Structs§
- Active
Run - A workflow run that has not ended.
- Asset
File - A Release asset
download_release_assetssaved. - Existing
Pr - An open pull request.
- NewRelease
- The Release a run creates for a tag: a draft for
release, or a Release published at once forensure_release. - Pull
Author - Who opened a pull request, and where its head branch lives.
- Release
List - The Releases of a repository as
GET /releaseslists them, drafts included, read at most once. - Release
Record - The part of a Release verctl reads, draft or published.
- Release
State - What GitHub has for one release tag.
- Repo
- A GitHub repository, as
owner/name.
Enums§
- Draft
State - A tag with no published Release, and the draft a run finds for it.
- Existing
Release - What a run finds on GitHub for one release tag, before it writes anything.
- Package
Upload - Whether a release run uploaded a package under a tag.
- Stage
- Where a Release stands: the stable one, or a candidate before it.
Constants§
- TAG_
PROOF_ DELAYS - How long the tag proof waits before each read after the first, while GitHub answers 404 for a tag that publishing the draft created. Five reads over 15 seconds, inside the 30 seconds the release-tag-order spec allows: GitHub can serve a new tag a moment after the Release that created it, as in rawr run 43414046487.
Functions§
- active_
run - The first run of the workflow file
workflowat commitshathat has not ended, fromGET /repos/{owner}/{repo}/actions/workflows/{workflow}/runswithhead_sha(list workflow runs). The first 100 runs of that commit are read, and the commit is checked again on each, so a server that ignores the filter finds no run for another commit. - asset_
content_ type - The HTTP
Content-Typeheader for an uploaded GitHub Release asset name, chosen from its filename suffix. - asset_
sha256 - The hex SHA-256 that GitHub stores for asset
namein thetagRelease. It comes from thedigestof the asset (sha256:<hex>, see release assets). Reading the digest from GitHub, instead of hashing a local file, keeps the checksum matching the stored asset. A rerun’s build can differ in bytes from the one GitHub kept. - base_
branch_ with - The branch a Version PR targets:
GITHUB_REF_NAME, elseVERCTL_DEFAULT_BRANCH, else the branchorigin/HEADnames. - branch_
rule_ types - The
typeof each rule that applies tobranch, fromGET /repos/{owner}/{repo}/rules/branches/{branch}(get rules for a branch). The list is empty when no rule applies. - close_
pr - Posts
commenton pull requestnumber, closes it, and returns its URL. - create_
pr - Opens a pull request from
headintobase. - default_
branch_ of repository.default_branchof an event payload, orNonewhen it does not parse or names none.- download_
release_ assets - Save each of
namesfrom the Release oftag, draft or published, intodirunder its own name. - ensure_
release - Create
tagatshaif it is missing. Returns the release HTML URL. - ensure_
vendored_ release - The Release for a vendored set’s
tag, created atshawhen the tag has none. Returns its HTML URL. - event_
default_ branch - The repository’s default branch named by the Actions event payload, or
Nonewithout an event. - event_
is_ merge_ group - Whether the Actions event is a merge queue’s
merge_groupevent, read from its payload. Without an event it isfalse. - existing_
pr - The open pull request from
headin this repository, if one exists. - fetch_
oidc_ token - Run one future to completion on a fresh current-thread runtime, so the
blocking command handlers can call async clients.
Request a GitHub Actions OIDC JWT from
request_urlforaudience, using bearerrequest_token, without exposing the token or URL query string in any error message. - is_
merge_ group - Whether an event payload is a
merge_groupevent’s. - open_
draft - The id of the draft for
release: the onefoundnames at HEAD, or a new draft withtarget_commitishset torelease.sha. A stale draft is deleted first. - parse_
remote - Parses an ssh or https remote URL on github.com or a
*.github.comhost. - parse_
slug - Parses an
owner/nameslug. - prove_
tag - Prove that
tagnameshead, reading it again after each ofdelayswhile GitHub answers 404. - publish_
draft - Publish the draft
idforrelease, which creates its tag atrelease.sha, and return the Release URL. - pull_
author - The author of pull request
number, fromGET /repos/{owner}/{repo}/pulls/{number}(get a pull request). - pull_
labels - The labels of pull request
number, fromGET /repos/{owner}/{repo}/pulls/{number}(get a pull request). - pull_
request_ is_ version_ pr - Whether the pull request of this
pull_requestevent is a Version PR by the identity of theversion-pr-identitydesign §1. Its head repository is this repository, and its head branch isverctl/release/<base>for the base it targets now. - pull_
request_ number - The pull request number of a
pull_requestevent payload, orNonewhen it does not parse or is another event’s. - read_
release - Read what GitHub has for
tag: the tag and its Release, draft or published, so a run reads what to create before it writes anything. - release_
state - Read the tag and the Release for
tag, so a plan can tell which parts of a release still need doing. The Release is read even when the tag is missing: a draft has no tag until it is published, so a tagless draft is an incomplete release. - release_
url - The HTML URL of the Release
id, draft or published, which the report of a run that leaves the draft names. - repo_
with - Actions sets
GITHUB_REPOSITORY. Locally,originis the contract. - update_
pr - Sets the title and body of pull request
numberand returns its URL. - upload_
release_ asset - Attach
tarballto the release fortag. - upload_
to_ release upload_release_assetto the Releaseidoftag, which this run opened or found, so the upload never looks the Release up by its tag again: two drafts can share a tag name.- uploaded_
assets - The names of the assets of the Release of
tag, draft or published, whose upload completed. - write_
draft_ body - Write
bodyas the notes of draftidoftag, and nothing else, so the draft keeps its state: a failed run records why it stopped there. - write_
output - Append to
$GITHUB_OUTPUT.