Skip to content

Add cross-forge commit ref resolution #151

Description

@andrew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions