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.
ci(bench-canonical): in-place README badge rewrite from cron (#477) #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
ci(bench-canonical): in-place README badge rewrite from cron (#477) #481
Changes from all commits
252f8161f850c4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 suggestion (security): Guard against shell interpretation of special characters in the badge text when passing it through the
newenv var.Using
new="${{ steps.badge.outputs.text }}" awk ...assumes the badge text never includes shell‑significant characters ($, backticks, backslashes, quotes, etc.). A future change to the badge text could cause the shell to reinterpret it and break this step. To harden this, consider passing the value toawkwithout letting the shell re‑parse it—for example, write the text to a temp file thatawkreads, or use a safely quotedprintfandenv NEW_TEXT="..." awk ...pattern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail fast when badge markers are missing/unbalanced.
Line 143–Line 146 can silently truncate the README tail if the end marker is absent. Add an explicit marker-count guard before rewrite.
Suggested hardening
- name: Sync README into bench-canonical-results worktree + rewrite badge if: steps.badge.outputs.text != '' run: | set -euo pipefail cp README.md .bench-results-branch/README.md + start_count=$(grep -c '<!-- bench-canonical-badge:start -->' .bench-results-branch/README.md || true) + end_count=$(grep -c '<!-- bench-canonical-badge:end -->' .bench-results-branch/README.md || true) + if [ "$start_count" -ne 1 ] || [ "$end_count" -ne 1 ]; then + echo "::error::README badge markers must exist exactly once (start=$start_count end=$end_count)" + exit 1 + fi new="${{ steps.badge.outputs.text }}" awk ' BEGIN { in_block=0 } /<!-- bench-canonical-badge:start -->/ { print; print ENVIRON["new"]; in_block=1; next } /<!-- bench-canonical-badge:end -->/ { print; in_block=0; next } in_block { next } { print } ' .bench-results-branch/README.md > .bench-results-branch/README.md.new mv .bench-results-branch/README.md.new .bench-results-branch/README.md🧰 Tools
🪛 GitHub Check: zizmor
[notice] 141-141:
code injection via template expansion
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.