Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractBaseRepo ¶ added in v0.51.7
ExtractBaseRepo extracts the base repository (owner/repo) from a repository path that may include subfolders. For "actions/checkout" -> "actions/checkout" For "github/codeql-action/upload-sarif" -> "github/codeql-action"
func FindGitRoot ¶ added in v0.51.7
FindGitRoot finds the root directory of the git repository. Returns an error if not in a git repository or if the git command fails.
func IsAuthError ¶
IsAuthError checks if an error message indicates an authentication issue. This is used to detect when GitHub API calls fail due to missing or invalid credentials.
func IsHexString ¶
IsHexString checks if a string contains only hexadecimal characters. This is used to validate Git commit SHAs and other hexadecimal identifiers.
func IsRateLimitError ¶ added in v0.64.1
IsRateLimitError checks if an error message indicates a GitHub API rate limit error. This is used to detect transient failures caused by hitting the GitHub API rate limit (HTTP 403 "API rate limit exceeded" or HTTP 429 responses).
func ReadFileFromHEAD ¶ added in v0.67.3
ReadFileFromHEAD returns the content of filePath as recorded in the most recent git commit (HEAD). This is used in safe update mode so that the manifest baseline comes from the committed version of the lock file, not from the working-tree copy, preventing a local agent from tampering with the file to bypass enforcement.
filePath may be absolute or relative; it is resolved to an absolute path before computing its path relative to the git root.
Returns an error when:
- the current directory is not inside a git repository
- the file does not exist in HEAD (e.g. it has never been committed)
- the git command fails for another reason
Types ¶
This section is empty.