export interface PinEntry { /** the original uses value, e.g. "actions/checkout@v6" */ original: string; /** the resolved commit hash */ hash: string; } export declare function isCommitHash(ref: string): boolean; export declare function parseActionUses(uses: string): { owner: string; repo: string; path: string; ref: string; } | undefined; export declare function resolveRef(owner: string, repo: string, ref: string): string; export type RefResolver = (owner: string, repo: string, ref: string) => string; /** * Resolves non-SHA refs in YAML content to commit hashes, writing the * original ref as an inline comment after the pinned `uses:` value. */ export declare function pinYamlContent(yamlStr: string, resolve?: RefResolver, cache?: readonly PinEntry[]): { content: string; pins: PinEntry[]; }; /** * Extracts pin entries from file content. Reads the current inline format * (`uses: owner/repo@HASH # ref`) and, for backwards compatibility, the * legacy footer format (`# gagen:pin owner/repo@ref = HASH`). */ export declare function parsePinComments(content: string): PinEntry[]; /** * Collects the pinned version for each action across a set of generated * YAML files. If an action appears in multiple files with different * versions, it is returned as a conflict instead — conflicts must be * resolved manually since there is no single correct target version. */ export declare function collectActionVersions(yamlContents: readonly string[]): { versions: Map; conflicts: Map; }; export interface VersionChange { action: string; from: string; to: string; } /** * Rewrites literal `"owner/repo@"` (or single-quoted) strings in * source code to use the target version from the given map. Only matches * literals with a single owner/repo[/path]@ref shape; variables, template * substitutions, and non-string forms are left alone. */ export declare function pullVersionsInSource(source: string, versions: ReadonlyMap): { content: string; changes: VersionChange[]; }; /** * Replaces pinned hashes in a parsed YAML object with their original * tag/branch refs using the provided pin mapping. */ export declare function unpinParsedYaml(obj: unknown, pins: PinEntry[]): unknown; //# sourceMappingURL=pin.d.ts.map