Skip to main content
Git notes allow you to attach metadata to commits without modifying the commit itself. Notes are stored in refs/notes/commits and are useful for storing build status, review comments, or other annotations.
const result = await repo.appendNote({
  sha: "abc123def456...",
  note: "\n---\nReviewed by @alice - LGTM",
  author: { name: "Review Bot", email: "review@example.com" },
});

console.log(`Note updated, new ref: ${result.newRefSha}`);

Options

sha
string
required
Commit SHA to attach the note to
note
string
required
Note content to append
author
string
Author signature (name and email)
expectedRefSha
string
Expected notes ref SHA for optimistic concurrency control
ttl
string
Token TTL. Token TTL in seconds.

Response

sha
string
The commit SHA the note is attached to
targetRef
string
The notes reference (refs/notes/commits)
baseCommit
string
Previous notes ref commit SHA
newRefSha
string
New notes ref SHA after the operation
result
object
Operation result with success, status, and optional message