You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --run-id option to process specific workflow run
This commit enhances `print_workflow_run_errors.py` by adding a
`--run-id` command-line option. This allows users to specify a
particular workflow run ID for processing, bypassing the default
behavior of searching for the latest run by workflow name and branch.
Key changes:
- Added `--run-id <ID>` optional argument.
- If `--run-id` is provided, the script fetches details for that specific
run using a new helper function `get_workflow_run_details_by_id`.
The `--workflow` and `--branch` arguments are ignored in this mode.
- If `--run-id` is not provided, the script retains its existing behavior
of using `--workflow` and `--branch` to find the latest run.
- The new helper function includes error handling for invalid or
non-existent run IDs.
- Standard error messages have been updated to reflect whether the script
is processing a run by specified ID or by search criteria.
sys.stderr.write(f"INFO: Log processing complete for this batch. Successfully fetched and processed logs for {successful_log_fetches}/{total_failed_jobs_to_process} job(s) from pattern '{current_pattern_str}'.\n")
sys.stderr.write(f"Error: Branch name is required. Please specify --branch or ensure it can be detected from your current git repository.{error_suffix}\n")
394
431
sys.exit(1)
395
432
396
-
sys.stderr.write(f"Processing workflow '{args.workflow}' on branch '{args.branch}' for repo {OWNER}/{REPO}\n")
433
+
run_details=None# This will hold the workflow run information
434
+
435
+
ifargs.run_id:
436
+
sys.stderr.write(f"INFO: Attempting to process directly specified workflow run ID: {args.run_id}\n")
437
+
# When run_id is given, --workflow and --branch are ignored as per help text.
438
+
# We need to fetch the run details to get its html_url and confirm existence.
0 commit comments