From 6c516f514c092572d6a45bdaeef43335528e18fe Mon Sep 17 00:00:00 2001 From: isaac-canvas <144165263+isaac-canvas@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:50:24 -0500 Subject: [PATCH] Limit api query to the date range --- get_workflow_runs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/get_workflow_runs.py b/get_workflow_runs.py index 52223b1..a0209d7 100644 --- a/get_workflow_runs.py +++ b/get_workflow_runs.py @@ -97,7 +97,9 @@ ) # Construct the gh api command -cmd = f'gh api repos/{repo_owner}/{repo_name}/actions/runs --paginate --jq \'{jq_query}\'' +cmd = (f'gh api repos/{repo_owner}/{repo_name}/actions/runs --paginate ' + f'--method GET -F created={start_date.strftime("%Y-%m-%d")}..{end_date.strftime("%Y-%m-%d")} ' + f'--jq \'{jq_query}\'') # Send the command and retrieve the output output = subprocess.check_output(cmd, shell=True, text=True)