Skip to main content
const tag = await repo.createTag({
  name: "v1.0.0",
  target: "abc123def456...", // commit SHA to tag
});

console.log(tag.name); // 'v1.0.0'
console.log(tag.sha);  // resolved SHA
Tag names must not start with refs/ — the SDK handles ref resolution automatically.

Options

name
string
required
Tag name (e.g. v1.0.0). Must not start with refs/.
target
string
required
Commit SHA the tag should point to.
refPolicies
object[]
Ordered per-ref policy rules ({ pattern, ops? }) embedded in the per-call JWT. First match wins. Python: ref_policies. Go: RefPolicies with type storage.RefPolicyList. See the Branch Protection guide.

Response

name
string
The created tag name
sha
string
The resolved commit SHA the tag points to
message
string
Confirmation message from the API