From 8ee9fddd9f8763d2b12e02780337ca6a8a571c1a Mon Sep 17 00:00:00 2001 From: Micah_Warren <26724012+MicahWW@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:01:15 -0500 Subject: [PATCH 1/3] Allow for direct version test --- src/get_cycle.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/get_cycle.py b/src/get_cycle.py index 1c762be..abc61c4 100644 --- a/src/get_cycle.py +++ b/src/get_cycle.py @@ -198,25 +198,27 @@ def _construct_summary(result): args = parser.parse_args() - if not args.file_path and not args.version: - sys.exit("Either file_path or version must be provided.") + # If version is supplied it supersedes others + if not args.version: + if not args.file_path: + sys.exit("Either file_path or version must be provided.") - if args.file_path and not (args.file_key or args.regex): - sys.exit( - "Either file_key or regex must be provided when extracting from file.") + if args.file_path and not (args.file_key or args.regex): + sys.exit( + "Either file_key or regex must be provided when extracting from file.") - if args.file_key and args.regex: - sys.exit("Only one of file_key or regex can be provided.") + if args.file_key and args.regex: + sys.exit("Only one of file_key or regex can be provided.") - if args.regex: - try: - re.compile(args.regex) - except re.error: - sys.exit(f"Invalid regular expression: '{args.regex}'") - args.file_format = "text" + if args.regex: + try: + re.compile(args.regex) + except re.error: + sys.exit(f"Invalid regular expression: '{args.regex}'") + args.file_format = "text" - if args.file_format not in ['yaml', 'json'] and not args.regex: - sys.exit("A regex must be provided when using text format.") + if args.file_format not in ['yaml', 'json'] and not args.regex: + sys.exit("A regex must be provided when using text format.") result = get_product_cycle(args) if not result: From 39d42a371a23dd5fe8ddc8282a420674ecf0b466 Mon Sep 17 00:00:00 2001 From: Micah_Warren <26724012+MicahWW@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:01:35 -0500 Subject: [PATCH 2/3] test for direct version --- .github/workflows/integrations-tests.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/integrations-tests.yml b/.github/workflows/integrations-tests.yml index 7d481b7..68c3ad5 100644 --- a/.github/workflows/integrations-tests.yml +++ b/.github/workflows/integrations-tests.yml @@ -47,6 +47,12 @@ jobs: product: 'azure-kubernetes-service' file_path: '__fixtures__/variables.tf' regex: '(?<=default = \")([^\"]+)' + - uses: ./ + name: Python (Version) + id: python + with: + product: python + version: 2.7 outputs: prometheus_end_of_life: "${{ steps.prometheus.outputs.end_of_life }}" @@ -55,6 +61,8 @@ jobs: grafana_version: "${{ steps.grafana.outputs.version }}" graylog_end_of_life: "${{ steps.graylog.outputs.end_of_life }}" graylog_version: "${{ steps.graylog.outputs.version }}" + python_end_of_life: "${{ steps.python.outputs.end_of_life }}" + python_version: "${{ steps.python.outputs.version}}" assert: runs-on: ubuntu-latest @@ -90,3 +98,13 @@ jobs: with: expected: 'v5.2.12' actual: "${{ needs.test.outputs.graylog_version }}" + - name: Assert Python EoL + uses: nick-fields/assert-action@v2 + with: + expected: 'true' + actual: "${{ needs.test.outputs.python_end_of_life }}" + - name: Assert Python extracted version + uses: nick-fields/assert-action@v2 + with: + expected: '2.7' + actual: "${{ needs.test.outputs.python_version }}" \ No newline at end of file From 58e2596e6b767e3dc9750e9a73c20217e18f47e0 Mon Sep 17 00:00:00 2001 From: Micah Warren <26724012+MicahWW@users.noreply.github.com> Date: Thu, 16 Oct 2025 10:34:17 -0500 Subject: [PATCH 3/3] Update spacing for steps output variable Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/integrations-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrations-tests.yml b/.github/workflows/integrations-tests.yml index 68c3ad5..5229e23 100644 --- a/.github/workflows/integrations-tests.yml +++ b/.github/workflows/integrations-tests.yml @@ -62,7 +62,7 @@ jobs: graylog_end_of_life: "${{ steps.graylog.outputs.end_of_life }}" graylog_version: "${{ steps.graylog.outputs.version }}" python_end_of_life: "${{ steps.python.outputs.end_of_life }}" - python_version: "${{ steps.python.outputs.version}}" + python_version: "${{ steps.python.outputs.version }}" assert: runs-on: ubuntu-latest