Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt

Use this file to discover all available pages before exploring further.

Patch a change. You can update metadata, apply file operations, use a base commit guard, or apply conflict resolutions.
import { Buffer } from 'node:buffer';

const change = await mesa.changes.patch({
  repo: 'app',
  change_id: 'zyxwvutsrqponmlkzyxwvutsrqponmlk',
  message: 'Update README',
  files: [
    {
      path: 'README.md',
      content: Buffer.from('# Updated\n').toString('base64'),
    },
  ],
});
Resolve conflicts:
await mesa.changes.patch({
  repo: 'app',
  change_id: 'zyxwvutsrqponmlkzyxwvutsrqponmlk',
  resolutions: [{ path: 'README.md', take: 'target' }],
});

Options

repo
string
required
Repository name.
change_id
string
required
Change ID to patch.
org
string | undefined
Organization override.
message
string | undefined
Replacement change message.
author
object | undefined
Replacement author identity.
committer
object | undefined
Replacement committer identity.
files
array | undefined
Non-empty file operations to apply. Cannot be combined with resolutions.
base_commit_oid
string | undefined
Optional optimistic concurrency guard. The patch fails if the change no longer points at this commit.
resolutions
array | undefined
Conflict resolutions to apply. Cannot be combined with files.

Response

Returns the updated change object.

Required scope

write