pub fn read_release(
token: &str,
repo: &Repo,
tag: &str,
head: &str,
list: &ReleaseList,
) -> Result<ExistingRelease>Expand description
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.
A tag that exists must name head, whatever the Release’s state: GitHub
uses an existing tag when a draft is published, so a tag on another commit
would fail the tag proof after the uploads.
A published Release counts as at HEAD when its tag names head, or when
GitHub serves no tag yet and the Release’s target_commitish is head.
A draft counts as at HEAD when its target_commitish is head, or when
its tag names head.
The Releases list comes from list, which the run shares with its plan.
§Errors
Returns an error when the GitHub client cannot be built, when a lookup
fails, when the tag names a commit other than head, or when a Release is
published at another commit.