Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAssetGlobs ¶ added in v0.81.0
CheckAssetGlobs applies the publish-time asset rules (matchAssets) without opening anything, so a refusal surfaces before anything is committed or pushed: every match must be a regular file inside the repository with a basename no other match has, and, unless allowMissing is set, every pattern must match at least one file (ADR-0076). The latter is wrapped in port.ErrAssetUnmatched so a dry run, where hooks have not built the files, can tell it apart. With allowMissing a pattern matching nothing is left for publishing to warn about.
func CheckAssetGlobsFor ¶ added in v0.82.0
CheckAssetGlobsFor is CheckAssetGlobs for a forge that renames assets: two matches whose names share rule.Key are refused as well, before anything is committed.
func CloseAssets ¶ added in v0.82.0
func CloseAssets(assets []Asset)
CloseAssets closes every file OpenAssets returned.
Types ¶
type Asset ¶ added in v0.82.0
Asset is a release asset opened for upload. Path is the match as the glob returned it, for messages; Name is its basename, the name it is published under. Size comes from the open file.
func OpenAssets ¶ added in v0.82.0
OpenAssets resolves the asset globs with the rules of matchAssets and opens every match, so an upload reads the file that was checked, not whatever the path names by the time it is read (NEW-002, ADR-0077). The open goes through an os.Root on the repository root, which refuses a path that leaves it even if a symlink is swapped in after the check, and os.SameFile confirms the descriptor is the file that was checked. On success the caller closes the files with CloseAssets; on error none is left open.