Skip to content

chore(create-cedar-rsc-app): push to upstream remote if it exists in publish script #1635

@lisa-assistant

Description

@lisa-assistant

Problem

packages/create-cedar-rsc-app/publish.ts unconditionally runs git push --follow-tags, but it should first check whether an upstream remote is configured. If it is, it should push to upstream (the canonical repo) rather than origin (the fork).

The commented-out code makes the intent clear:

// TODO: Check if there is an upstream remote, if so, use that
// await `git push upstream --follow-tags`
await `git push --follow-tags`

A maintainer running this from a fork will push the version tag to their fork rather than the main repo.

Fix

Check the list of git remotes before pushing. If upstream is present, push to it; otherwise fall back to the current default.

const remotes = (await $`git remote`).stdout.trim().split('\n')
if (remotes.includes('upstream')) {
  await $`git push upstream --follow-tags`
} else {
  await $`git push --follow-tags`
}

Files to change

  • packages/create-cedar-rsc-app/publish.ts — replace the unconditional git push with a remote-aware branch (lines 61–63)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions