* Push a branch to origin, optionally using a custom GitHub token. * * When `BUMPY_GH_TOKEN` is set, the remote URL is temporarily rewritten to * include the token. Pushes made with a PAT or GitHub App token bypass * GitHub's anti-recursion guard, allowing `pull_request` workflows to fire * on
(rootDir: string, branch: string, config: BumpyConfig)
| 697 | * bumpy ci release --snapshot pr-${{ github.event.pull_request.number }} |
| 698 | * |
| 699 | * Re-running on a new commit republishes and floats the dist-tag (and the comment updates |
| 700 | * in place). On forks the publish token and PR-comment token are unavailable — expected, |
| 701 | * since snapshots target a registry only trusted contributors can publish to. |
| 702 | */ |
| 703 | async function ciSnapshotRelease(rootDir: string, opts: ReleaseOptions): Promise<void> { |
| 704 | const { publishCommand } = await import('./publish.ts'); |
| 705 | const outcome = await publishCommand(rootDir, { snapshot: opts.snapshot, tag: opts.tag }); |
| 706 | if (!outcome || outcome.published.length === 0) return; |
| 707 | |
| 708 | const prNumber = detectPrNumber(); |
| 709 | if (!prNumber) { |
| 710 | log.dim(' No PR detected — skipping snapshot install-instructions comment.'); |
| 711 | return; |
| 712 | } |
| 713 | const pm = await detectPackageManager(rootDir); |
| 714 | const comment = formatSnapshotComment(outcome.snapshot, outcome.published, pm); |
| 715 | await postOrUpdatePrComment(prNumber, comment, rootDir, SNAPSHOT_COMMENT_MARKER); |
| 716 | } |
| 717 | |
| 718 | // ---- Token-aware push ---- |
| 719 | |
| 720 | /** |
| 721 | * Push a branch to origin, optionally using a custom GitHub token. |
| 722 | * |
no test coverage detected
searching dependent graphs…