MCPcopy Create free account
hub / github.com/METR/vivaria / create_commit_permalink

Function create_commit_permalink

cli/viv_cli/github.py:31–46  ·  view source on GitHub ↗

Create the permalink to a commit on GitHub. Example: >>> create_commit_permalink("aisi", "llm-agents", "12345") 'https://github.com/aisi/llm-agents/tree/12345' Args: org: GitHub organization. repo: GitHub repository. commit_id: Commit hash. Retu

(org: str, repo: str, commit_id: str)

Source from the content-addressed store, hash-verified

29
30
31def create_commit_permalink(org: str, repo: str, commit_id: str) -> str:
32 """Create the permalink to a commit on GitHub.
33
34 Example:
35 >>> create_commit_permalink("aisi", "llm-agents", "12345")
36 'https://github.com/aisi/llm-agents/tree/12345'
37
38 Args:
39 org: GitHub organization.
40 repo: GitHub repository.
41 commit_id: Commit hash.
42
43 Returns:
44 Permalink to the commit.
45 """
46 return f"https://github.com/{org}/{repo}/tree/{commit_id}"
47
48
49def get_org_and_repo() -> tuple[str, str]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected