Skip to content

Commit f6ac1b3

Browse files
committed
Fix _delete_gitignore()
1 parent 2765449 commit f6ac1b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

onlinejudge_verify/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ def _delete_gitignore() -> None:
212212
if not should_push:
213213
return
214214

215+
# checkout the target branch
216+
branch = os.environ['GITHUB_REF'][len('refs/heads/'):]
217+
logger.info('$ git checkout %s', branch)
218+
subprocess.check_call(['git', 'checkout', branch])
219+
215220
# check if .verify-helper/.gitignore exists
216221
gitignore_path = pathlib.Path('.verify-helper', '.gitignore')
217222
gitignore_checked_in = (subprocess.run(['git', 'ls-files', '--error-unmatch', str(gitignore_path)]).returncode == 0)

0 commit comments

Comments
 (0)