PR #150 adds github.CommitResolver so callers can turn branch names, tags, and abbreviated SHAs into full commit SHAs without listing every tag. The resolver currently calls the GitHub API directly.
Gitea and Forgejo support Actions workflows with similar action references, and other forge-backed package sources need the same immutable ref resolution. Callers should be able to request it through a forge-level API instead of importing the GitHub backend.
Expected behavior:
- Define a shared commit resolver contract or service.
- Implement it for GitHub, GitLab, and Gitea/Forgejo.
- Resolve branches, tags, and abbreviated commit refs to full commit SHAs.
- Return
forge.ErrNotFound when a ref does not exist.
Current behavior: only the GitHub-specific resolver proposed in #150 provides this operation.
To reproduce, create a GitLab or Gitea/Forgejo backend and try to resolve a repository ref to its full commit SHA. The shared Forge interface has no commit-resolution method.
Version: current main, with the initial GitHub implementation proposed in #150.
PR #150 adds
github.CommitResolverso callers can turn branch names, tags, and abbreviated SHAs into full commit SHAs without listing every tag. The resolver currently calls the GitHub API directly.Gitea and Forgejo support Actions workflows with similar action references, and other forge-backed package sources need the same immutable ref resolution. Callers should be able to request it through a forge-level API instead of importing the GitHub backend.
Expected behavior:
forge.ErrNotFoundwhen a ref does not exist.Current behavior: only the GitHub-specific resolver proposed in #150 provides this operation.
To reproduce, create a GitLab or Gitea/Forgejo backend and try to resolve a repository ref to its full commit SHA. The shared
Forgeinterface has no commit-resolution method.Version: current
main, with the initial GitHub implementation proposed in #150.