Skip to main content
Enqueue a sync for the configured upstream remote.
const run = await mesa.repos.syncUpstream({ repo: 'app', direction: 'pull' });
console.log(run.id, run.status);

await mesa.repos.syncUpstream({
  repo: 'app',
  direction: 'pull',
  ref_globs: {
    branches: 'main',
  },
});

Options

repo
string
required
Repository name.
direction
'pull' | 'push'
required
pull fetches from upstream into Mesa. push sends Mesa branches and tags to upstream.
ref_globs
{ branches?: string; tags?: string } | undefined
Branch and tag glob filters for this sync. Omit this field to sync all supported branches and tags. If provided, include at least one of branches or tags.
ref_globs.branches
string
Glob matched against upstream branch names, such as main, release/*, or *. Omit or use an empty string to match no branches. Do not include refs/heads/.
ref_globs.tags
string
Glob matched against upstream tag names, such as v1.* or *. Omit or use an empty string to match no tags. Do not include refs/tags/.
org
string | undefined
Organization override.

Response

Returns a sync object with fields such as id, repo_id, direction, status, attempt, ref_globs, stats, error, created_at, started_at, and finished_at. ref_globs is returned as normalized branch and tag glob filters. stats.refs contains only source refs that matched the filters.

Required scope

write