From: Patrick Donnelly Date: Wed, 16 Jul 2025 14:10:30 +0000 (-0400) Subject: script/redmine-upkeep: check envvar to see if running as action X-Git-Tag: testing/wip-vshankar-testing-20250813.085004-debug~6^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd768b6d5c788c3ed0d310c5fafdf75e3f0e2d72;p=ceph-ci.git script/redmine-upkeep: check envvar to see if running as action This obviates --github-action in the workflow. Signed-off-by: Patrick Donnelly --- 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')