]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
script/redmine-upkeep: check envvar to see if running as action
authorPatrick Donnelly <pdonnell@ibm.com>
Wed, 16 Jul 2025 14:10:30 +0000 (10:10 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Tue, 12 Aug 2025 16:01:24 +0000 (12:01 -0400)
This obviates --github-action in the workflow.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/script/redmine-upkeep.py

index dbcaf6b272e9826b99474e5f42fde00e25bff56a..e05409c8be35e0d1e8a98148f94af841934a3811 100755 (executable)
@@ -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')