fix: sanitize GitHub Actions output in maintenance workflow#1070
Merged
GrammaTonic merged 2 commits intomainfrom Dec 4, 2025
Merged
fix: sanitize GitHub Actions output in maintenance workflow#1070GrammaTonic merged 2 commits intomainfrom
GrammaTonic merged 2 commits intomainfrom
Conversation
- Add write_output() helper function to sanitize version values - Removes CR, collapses newlines, trims whitespace - Writes "unknown" for empty values to prevent format errors - Applied to both extract-versions and check-updates steps - Fixes "Unable to process file command 'output' successfully" error - Prevents issues when grep patterns don't match (e.g., flat@, playwright@) Resolves failing workflow run at: https://github.com/GrammaTonic/github-runner/actions/runs/19915664449/job/57093663236 Co-authored-by: GrammaTonic <8269379+GrammaTonic@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Modify version extraction to sanitize outputs in maintenance workflow
fix: sanitize GitHub Actions output in maintenance workflow
Dec 4, 2025
GrammaTonic
approved these changes
Dec 4, 2025
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.
📋 Pull Request Description
🔀 Merge Strategy
This repository uses SQUASH MERGE as the standard merge strategy.
Why Squash Merge?
mainbranch - easier to understand project evolutionHow to Create a PR (Recommended):
How to Merge (Recommended):
main, you MUST back-syncdevelop(see Post-Merge Back-Sync section below).Branch Sync Requirements:
mainbranch:git pull origin maindevelopbranch:git pull origin developQuick sync commands:
Post-Merge Back-Sync (CRITICAL after squash merging to main):
Why is this needed?
When you squash merge a PR from
developtomain, the individual commits fromdevelopare condensed into a single commit onmain. This causesdevelopto appear "ahead" ofmainin git history, even though the code is identical. The back-sync merge resolves this divergence and prevents:developWhen to perform back-sync:
develop→main) with squash mergemainwith squash mergedevelop(develop will be promoted later)How to perform back-sync:
Alternative (using GitHub CLI):
Verification:
Troubleshooting:
Summary
Maintenance workflow fails with
Unable to process file command 'output' successfully. Invalid formatwhen version extraction produces empty values. Direct writes to$GITHUB_OUTPUTbreak on empty strings, newlines, or special characters.Type of Change
Related Issues
Resolves workflow run failure: https://github.com/GrammaTonic/github-runner/actions/runs/19915664449/job/57093663236
🔄 Changes Made
Files Modified
.github/workflows/maintenance.yml- Added sanitization helper for version extraction stepsKey Changes
Added
write_output()helper function:"unknown"for empty valueskey=valueformat for$GITHUB_OUTPUTApplied to two steps:
extract-versions: Sanitizes RUNNER_VERSION, NODE_VERSION, PLAYWRIGHT_VERSION, CYPRESS_VERSION, FLAT_VERSIONcheck-updates: Sanitizes LATEST_RUNNER, LATEST_NODE, runner-needs-update flagAdditional hardening:
2>/dev/nullto grep commands (suppresses errors on missing files)head -n1to RUNNER_VERSION extraction (consistency).xsuffix when pattern doesn't matchBefore:
After:
🧪 Testing
Testing Performed
Test Coverage
Manual Testing Steps
write_output()with edge cases: empty values, newlines, carriage returns, whitespacekey=valueformatTest results:
📸 Screenshots/Demos
N/A - Workflow fix, no UI changes.
🔒 Security Considerations
📚 Documentation
docs/updated🚀 Deployment Notes
✅ Checklist
🤖 AI Review Request
/cc @copilot
Note for Reviewers:
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.