@@ -164,14 +164,13 @@ def make_changelog_pr(auth, branch, repo, title, commit_message, body, dry_run=F
164
164
# Make a new branch with a uuid suffix
165
165
pr_branch = f"changelog-{ uuid .uuid1 ().hex } "
166
166
167
- if not dry_run :
168
- dirty = util .run ("git --no-pager diff --stat" ) != ""
169
- if dirty :
170
- util .run ("git stash" )
171
- util .run (f"{ util .GIT_FETCH_CMD } { branch } " )
172
- util .run (f"git checkout -b { pr_branch } origin/{ branch } " )
173
- if dirty :
174
- util .run ("git stash apply" )
167
+ dirty = util .run ("git --no-pager diff --stat" ) != ""
168
+ if dirty :
169
+ util .run ("git stash" )
170
+ util .run (f"{ util .GIT_FETCH_CMD } { branch } " )
171
+ util .run (f"git checkout -b { pr_branch } origin/{ branch } " )
172
+ if dirty :
173
+ util .run ("git stash apply" )
175
174
176
175
# Add a commit with the message
177
176
try :
@@ -188,8 +187,8 @@ def make_changelog_pr(auth, branch, repo, title, commit_message, body, dry_run=F
188
187
head = pr_branch
189
188
maintainer_can_modify = True
190
189
191
- if not dry_run :
192
- util .run (f"git push origin { pr_branch } " )
190
+ remote_name = util . get_remote_name ( dry_run )
191
+ util .run (f"git push { remote_name } { pr_branch } " )
193
192
194
193
# title, head, base, body, maintainer_can_modify, draft, issue
195
194
pull = gh .pulls .create (title , head , base , body , maintainer_can_modify , False , None )
@@ -265,9 +264,10 @@ def draft_release(
265
264
if delta .days > 0 :
266
265
gh .repos .delete_release (release .id )
267
266
268
- remote_url = util .run ("git config --get remote.origin.url" )
269
- if not dry_run and not os .path .exists (remote_url ):
270
- util .run (f"git push origin HEAD:{ branch } --follow-tags --tags" )
267
+ remote_name = util .get_remote_name (dry_run )
268
+ remote_url = util .run (f"git config --get remote.{ remote_name } .url" )
269
+ if not os .path .exists (remote_url ):
270
+ util .run (f"git push { remote_name } HEAD:{ branch } --follow-tags --tags" )
271
271
272
272
util .log (f"Creating release for { version } " )
273
273
util .log (f"With assets: { assets } " )
0 commit comments