RemoteIdentity returns a stable, credential-free identity string for the repository's "origin" remote, suitable for hashing into the run manifest's repository.identity_sha256. It reads the configured origin URL and canonicalizes it — dropping any embedded userinfo, query and fragment (so credentials
(ctx context.Context)
| 386 | // it was cloned. It returns "" when there is no origin remote, or when origin is |
| 387 | // a local-filesystem remote (the caller then omits repository identity). |
| 388 | func (p *Provider) RemoteIdentity(ctx context.Context) string { |
| 389 | out, err := p.runGit(ctx, "remote", "get-url", "origin") |
| 390 | if err != nil { |
| 391 | return "" |
| 392 | } |
| 393 | return canonicalRemote(firstLine(out)) |
| 394 | } |
| 395 | |
| 396 | // canonicalRemote reduces a git remote URL to a stable, credential-free identity |
| 397 | // string for hashing into repository.identity_sha256, so the same repository |