diff --git a/scripts/process-issues.py b/scripts/process-issues.py index 7ee7a5a..3d6a69a 100644 --- a/scripts/process-issues.py +++ b/scripts/process-issues.py @@ -12,10 +12,10 @@ def main(): instance_url = os.environ['INSTANCE_URL'].rstrip('/') repository = os.environ['REPOSITORY'] token = os.environ['TOKEN'] - stale_days = os.environ.get('STALE_DAYS') - stale_tag = os.environ.get('STALE_TAG', 'stale') - exclude_tag = os.environ.get('EXCLUDE_TAG') - required_tag = os.environ.get('REQUIRED_TAG') + stale_days = int(os.environ.get('STALE_DAYS')) + stale_tag = int(os.environ.get('STALE_TAG')) + exclude_tag = int(os.environ.get('EXCLUDE_TAG')) + required_tag = int(os.environ.get('REQUIRED_TAG')) except KeyError as e: print(f"Error: Missing required environment variable: {e}", file=sys.stderr) sys.exit(1) diff --git a/scripts/process-pull-requests.py b/scripts/process-pull-requests.py index cb8c6ae..d55a2c6 100644 --- a/scripts/process-pull-requests.py +++ b/scripts/process-pull-requests.py @@ -12,10 +12,10 @@ def main(): instance_url = os.environ['INSTANCE_URL'].rstrip('/') repository = os.environ['REPOSITORY'] token = os.environ['TOKEN'] - stale_days = os.environ.get('STALE_DAYS') - stale_tag = os.environ.get('STALE_TAG', 'stale') - exclude_tag = os.environ.get('EXCLUDE_TAG') - required_tag = os.environ.get('REQUIRED_TAG') + stale_days = int(os.environ.get('STALE_DAYS')) + stale_tag = int(os.environ.get('STALE_TAG')) + exclude_tag = int(os.environ.get('EXCLUDE_TAG')) + required_tag = int(os.environ.get('REQUIRED_TAG')) except KeyError as e: print(f"Error: Missing required environment variable: {e}", file=sys.stderr) sys.exit(1) @@ -40,7 +40,6 @@ def main(): enable_stale_tag= False print(f">> No value for stale days.") else: - stale_days = int(stale_days) older_than_date = datetime.now(timezone.utc) - timedelta(days=stale_days) enable_stale_tag = True @@ -105,11 +104,11 @@ def main(): continue print(f">> Will tag PR #{pr_number} with '{stale_tag}'") - update_labels = list(update_labels | {stale_tag}) + update_labels.add(stale_tag) # --- Make update with new labels --- - update_payload = {'labels': update_labels} + update_payload = {'labels': list(update_labels)} update_url = f"{base_api_url}/{pr_number}/labels" print(f">> Updating PR #{pr_number} ...")