Skip to content

Commit 2f0aab6

Browse files
Update grep defaults in workflow error script
This commit refines the grep functionality in the `print_workflow_run_errors.py` script by updating default values: - The default `--grep-pattern` is now `"[Ee]rror[: ]"`. Logs will be automatically filtered for this pattern if no other pattern is specified. - The default `--grep-context` is now 10 lines. If an empty string is explicitly passed to `--grep-pattern` (e.g., `--grep-pattern ""`), grep functionality will be disabled, and the script will fall back to printing the last N lines of the log.
1 parent 6ba2558 commit 2f0aab6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/print_workflow_run_errors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ def parse_repo_url_arg(url_string):
159159
parser.add_argument(
160160
"--grep-pattern", "-g",
161161
type=str,
162-
default=None,
163-
help="Extended Regular Expression (ERE) to search for in logs. If provided, log output will be filtered by grep."
162+
default="[Ee]rror[: ]",
163+
help="Extended Regular Expression (ERE) to search for in logs. Default: \"[Ee]rror[: ]\". If an empty string is passed, grep is disabled."
164164
)
165165
parser.add_argument(
166166
"--grep-context", "-C",
167167
type=int,
168-
default=5,
169-
help="Number of lines of leading and trailing context to print for grep matches. Default: 5."
168+
default=10,
169+
help="Number of lines of leading and trailing context to print for grep matches. Default: 10."
170170
)
171171

172172
args = parser.parse_args()

0 commit comments

Comments
 (0)