Update pr-push skill to detect correct remote for pushing (#2469)
## Summary
- Updated the pr-push skill's push step to detect the correct remote
instead of always defaulting to `origin`
- When no upstream is set, the skill now checks the PR's head repository
owner to find the matching local remote
- This handles cases where pushing to another user's fork (e.g. when
fixing someone else's PR)
## Test plan
- Test by running `/dyad:pr-push` on a branch that was checked out from
another user's fork PR
- Verify it pushes to the correct remote (not always `origin`)
#skip-bugbot
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2469">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Update pr-push to auto-detect and push to the correct remote instead of
always using origin. This fixes pushes for branches from forks and PRs
opened from another user’s repo.
- **New Features**
- Use the branch’s upstream if set; otherwise match the PR’s head repo
to a local remote by owner/repo (works for SSH/HTTPS/token URLs).
- If no upstream and no PR/match, push to origin; if origin is denied,
try upstream (per workflow).
- Push with --force-with-lease and set -u when establishing the
upstream; surface gh pr view errors instead of silently falling back.
<sup>Written for commit e24e347cc7ddc3cb68343100d696d775c75cffe6.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
请
注册
或者
登录
后发表评论