Skip to content

Commit 78b1b9a

Browse files
IMXErennikhilbadyal
authored andcommitted
fix(check_updates): executing DRY_RUN branch when set to non-empty string
1 parent 56fda62 commit 78b1b9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/manager/github.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Github Manager."""
22

33
import json
4-
import os
54
import urllib.request
65
from pathlib import Path
76
from typing import Self
@@ -22,10 +21,11 @@ def __init__(self: Self, env: Env) -> None:
2221
branch_name=branch_name,
2322
updates_file=updates_file,
2423
)
24+
self.is_dry_run = env.bool("DRY_RUN", False)
2525

2626
def get_last_version(self: Self, app: APP, resource_name: str) -> str | list[str]:
2727
"""Get last patched version."""
28-
if os.getenv("DRY_RUN", default=None):
28+
if self.is_dry_run:
2929
with Path(updates_file).open() as url:
3030
data = json.load(url)
3131
else:
@@ -39,7 +39,7 @@ def get_last_version(self: Self, app: APP, resource_name: str) -> str | list[str
3939

4040
def get_last_version_source(self: Self, app: APP, resource_name: str) -> str | list[str]:
4141
"""Get last patched version."""
42-
if os.getenv("DRY_RUN", default=None):
42+
if self.is_dry_run:
4343
with Path(updates_file).open() as url:
4444
data = json.load(url)
4545
else:

0 commit comments

Comments
 (0)