From bd768b6d5c788c3ed0d310c5fafdf75e3f0e2d72 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 16 Jul 2025 10:10:30 -0400 Subject: [PATCH] script/redmine-upkeep: check envvar to see if running as action This obviates --github-action in the workflow. Signed-off-by: Patrick Donnelly --- src/script/redmine-upkeep.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script/redmine-upkeep.py b/src/script/redmine-upkeep.py index dbcaf6b272e..e05409c8be3 100755 --- a/src/script/redmine-upkeep.py +++ b/src/script/redmine-upkeep.py @@ -39,6 +39,8 @@ except FileNotFoundError: pass GITHUB_TOKEN = os.getenv("GITHUB_TOKEN", GITHUB_TOKEN) +GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == 'true' + GITHUB_USER = os.getenv("GITHUB_USER", os.getenv("GITHUB_USER", getuser())) GITHUB_ORG = "ceph" GITHUB_REPO = "ceph" @@ -995,7 +997,7 @@ h2. Update Payload def main(): parser = argparse.ArgumentParser(description="Ceph redmine upkeep tool") parser.add_argument('--debug', dest='debug', action='store_true', help='turn debugging on') - parser.add_argument('--github-action', dest='gha', action='store_true', help='github action output') + parser.add_argument('--github-action', default=GITHUB_ACTIONS, dest='gha', action='store_true', help='github action output') parser.add_argument('--limit', dest='limit', action='store', type=int, default=200, help='limit processed issues') parser.add_argument('--git-dir', dest='git', action='store', default=".", help='git directory') -- 2.39.5