Expand description
Git repository access, commit history, tree reads, fetch, and push for
verctl.
Structs§
- AddedBy
- The commit that added a file, as the changelog names it.
- Deleted
- A file a commit deleted, as its first parent had it.
- Merge
Base - The tree at the merge-base of HEAD and the pull request’s base, and the paths the working tree changes against it. The content check for a Version PR replays the version step on this tree.
- Version
Commit - A commit that carries a package’s release, and how far it sits below HEAD.
Enums§
- Fetch
Default - How to fetch
origin/<branch>when that ref is missing. - Ignored
Files - Whether
assert_only_allowedand status lookups inspect gitignored files. - Push
Outcome - What
commit_branch_and_pushdid:Emptywhen the tree was unchanged.
Functions§
- added_
by - The commit that added
path. It is the newest commit on HEAD’s first-parent history whose tree has the file and whose first parent’s tree does not. - added_
by_ from added_byfromstartinstead of HEAD.- assert_
only_ allowed - Fail if the worktree has dirty paths outside
allowedandglobs. - candidate_
deletions - The files under
dirthat each candidate’s Version PR deleted since the version inmanifestwas last stable, newest first. - commit_
branch_ and_ push - Commits
pathsontobranchwithout moving HEAD, then force-pushesbranchtogithubover HTTPS withtoken. - comparison_
branches - The branches a version comparison fetches when they are missing:
VERCTL_DEFAULT_BRANCH, then the event’s repository default branch, thenGITHUB_BASE_REF. The default branch is fetched even when the pull request targets another branch, so the released baseline reads the same branch a full clone would. None is set outside Actions, so a local run fetches nothing. - configured_
default_ branch VERCTL_DEFAULT_BRANCHonly.- current_
branch - The checked-out branch, or
Nonefor a detached HEAD or no repository. - default_
branch_ candidates GITHUB_BASE_REF(PR base) thenmain/master.- default_
branch_ candidates_ from - Like
default_branch_candidates, but the caller supplies the base ref and the environment is not read. - default_
tip - The commit at the default branch’s tip, as a full hex SHA. The branch
resolves as for
files_on_merge_base:origin/HEAD, or else the first ofcandidatesthatoriginhas. - ensure_
comparable - Fetch
origin/<branch>so a merge-base with HEAD can be computed: when the ref is missing, or when the clone is shallow. - ensure_
full_ history - Fetch the whole history of
origin/<branch>when the clone is shallow. - ensure_
origin_ head - Point
origin/HEADatorigin/<branch>. Fetch that one ref only when it is missing. The fetch gets the branch’s history instead of a depth-1 tip, becauseoff_default_historywalks parents. - file_at
- The text of
pathat commitsha, orNonewhen that commit contains no such file. - files_
named_ at - Every blob named
file_nameunderdirat commitsha, as(path relative to dir, UTF-8 text)pairs. - files_
on_ merge_ base - File contents at the merge-base of HEAD and the default branch.
- github_
git_ user - Username GitHub git-over-HTTPS expects. Not an HTTP Bearer scheme.
- github_
https_ url - HTTPS URL for an
owner/nameslug. No credentials in the URL. - head_
contains_ commit - Whether
HEADcontains commitsha(either equal toHEADor an ancestor ofHEAD). - head_
sha - The commit HEAD names, as a full hex SHA.
- is_
ignored - Whether the repository is told to ignore
rel, a path relative toroot. - is_
repository - Whether a repository covers
rootat all. - matches_
stage - Whether
relmatches aprepare.stageglobpattern(either directly or with a leading./). - off_
default_ history - Whether HEAD is off the default-branch history:
Nonewhen the default branch contains HEAD, or why it does not, naming both commits. - origin_
url - The URL of the
originremote. - pull_
request_ number - The pull request a squash-merge subject names: a trailing
(#N). - read_
optional - A file’s bytes, or
Nonewhen it does not exist. - release_
branch_ candidates - The branch releases come from, whatever branch a pull request targets. The candidates, in order:
- tagged_
commit shaas the release commit of the versionreadfinds inpathat HEAD, when HEAD containsshaandshacarries that version.- tagged_
commit_ from - Like
tagged_commit, starting from commitstartinstead of HEAD. - tracked
- Every path git tracks under
root, relative torootitself. - upstream_
default_ branch - The branch
origin/HEADpoints at, orNonewhen that ref is unset. - workdir_
covering - The working tree that contains
dir, canonicalized. - workflows_
differ - Whether
.github/workflows/at the commit the run executes differs from the default branch’s tip. It isNonewhen the two trees are the same object, and otherwise names both commits.