diff --git a/shared/dfinity/dre.py b/shared/dfinity/dre.py index b444621..4109243 100644 --- a/shared/dfinity/dre.py +++ b/shared/dfinity/dre.py @@ -140,11 +140,11 @@ def run( if dry_run: cmd.append("--dry-run") if yes and not dry_run: - pos = cmd.index("propose") - if pos == -1: - cmd.append("--yes") - else: + try: + pos = cmd.index("propose") cmd.insert(pos + 1, "--yes") + except ValueError: + cmd.append("--yes") print("::group::DRE output") if full_stdout: