Fix stale Known Build Error workflow (CRLF regex bug)#54174
Merged
marcpopMSFT merged 2 commits intodotnet:mainfrom May 5, 2026
Merged
Fix stale Known Build Error workflow (CRLF regex bug)#54174marcpopMSFT merged 2 commits intodotnet:mainfrom
marcpopMSFT merged 2 commits intodotnet:mainfrom
Conversation
- Fix regex to handle \r\n line endings in issue bodies - Add console.log for debugging - Allow running on MichaelSimons fork for testing - Add workflow_dispatch trigger Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The stale-known-build-errors job was silently failing because GitHub issue bodies use CRLF line endings (\r\n) but the regex used \n. This caused the hit count table to never match, so no issues were ever labeled stale. Changes: - Fix regex to handle CRLF: \n → \r?\n - Add diagnostic console.log statements for troubleshooting - Add workflow_dispatch trigger to allow manual runs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the stale-issue workflow logic for Known Build Error (KBE) issues so the automation can correctly parse the hit-count table from issue bodies and apply/remove the stale label as intended.
Changes:
- Fix hit-count table parsing by updating the regex to handle CRLF (
\r?\n) line endings. - Add diagnostic
console.logoutput to make matching/labeling decisions visible in workflow logs. - Add
workflow_dispatchto allow manually triggered runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
stale-known-build-errorsjob in the stale workflow was silently failing to match any issues. No Known Build Error issues were ever being labeledstale, regardless of their hit counts.Root Cause
GitHub issue bodies use CRLF line endings (
\r\n), but the regex used bare\nto match line breaks in the hit count table. This caused the regex to never match, so the job would iterate over all issues but skip every one.Fix
\nto\r?\nin the table-matching regexconsole.logstatements so future issues are visible in workflow run logsworkflow_dispatchto allow on-demand runs for testing/verificationValidation
Tested on MichaelSimons/sdk fork with synthetic test issues:
stalewith commentRelated to #54017