Skip to content

fix: address Gemini code review feedback on profile README generation#3963

Merged
marcusquinn merged 2 commits intomainfrom
fix/profile-readme-review-feedback
Mar 9, 2026
Merged

fix: address Gemini code review feedback on profile README generation#3963
marcusquinn merged 2 commits intomainfrom
fix/profile-readme-review-feedback

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

@marcusquinn marcusquinn commented Mar 9, 2026

Summary

Addresses all actionable findings from Gemini Code Assist review on PR #3962.

Changes

Performance

  • Consolidate user profile jq — 4 separate jq calls → single pass with tab-delimited output; removed 2>/dev/null stderr suppression so jq errors are visible
  • Consolidate own repos jq — eliminated per-row jq invocations in while loop; single jq pass generates all markdown lines
  • Parallel fork parent URL fetch — replaced sequential N+1 gh api calls with xargs -P 6 for up to 6x speedup on users with many forks

Security

  • New _sanitize_md() helper — strips markdown-breaking characters ([]() and backticks) from user-controlled fields (display_name, bio)
  • New _sanitize_url() helper — rejects javascript:, data:, and non-http(s) schemes from blog URLs
  • Twitter username sanitization — strips non-alphanumeric/underscore characters

Gemini findings addressed

# Finding Resolution
1 N+1 API calls for fork parent URLs Parallel xargs -P 6 batch fetch
2 Multiple jq calls per own repo Single jq pass
3 Unsanitized language in badge fallback Skipped — GitHub API language names are controlled
4 Blog/twitter could contain javascript: URIs _sanitize_url() rejects non-http(s)
5 Display name/bio markdown injection _sanitize_md() strips breaking chars
6 4 separate jq calls for user profile Single jq pass with tab delimiter

Testing

  • ShellCheck: zero violations
  • Tested against johnwaldo (no blog/twitter) — correct output, parent URLs resolved
  • Tested against marcusquinn (has blog + twitter) — correct sanitization and rendering

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced input validation and sanitization to prevent special characters from breaking readme formatting
    • Improved URL validation to reject invalid links in profile data
  • Refactor

    • Optimized profile data processing to use consolidated batch operations instead of repeated individual queries
    • Streamlined repository information gathering for better performance

- Consolidate 4 separate jq calls for user profile into single pass with
  tab-delimited output, remove stderr suppression (Gemini #6)
- Consolidate own repos loop into single jq pass, eliminating per-row
  jq invocations (Gemini #2)
- Replace sequential N+1 gh api calls for fork parent URLs with parallel
  xargs -P 6 batch fetch (Gemini #1)
- Add _sanitize_md() and _sanitize_url() helpers to sanitize user-controlled
  fields (display_name, bio, blog, twitter) before embedding in markdown,
  preventing markdown injection and javascript: URI attacks (Gemini #4, #5)

Ref: PR #3962 review comments from gemini-code-assist
@github-actions github-actions bot added the bug Something isn't working label Mar 9, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses feedback from a Gemini Code Assist review, focusing on enhancing the profile-readme-helper.sh script. The changes primarily improve the script's performance by optimizing data fetching and processing, and bolster its security by implementing robust sanitization for user-controlled input to prevent potential markdown injection and unsafe URL usage.

Highlights

  • Performance Improvements: Consolidated multiple jq calls for user profile data and own repositories into single passes, significantly reducing overhead. Parallelized the fetching of parent URLs for forked repositories using xargs -P 6, leading to up to a 6x speedup for users with many forks.
  • Security Enhancements: Introduced _sanitize_md() and _sanitize_url() helper functions to strip markdown-breaking characters from user-controlled fields (display name, bio) and reject unsafe URI schemes (e.g., javascript:, data:) from blog URLs. Twitter usernames are now sanitized to only allow alphanumeric characters and underscores.
  • Error Visibility: Removed 2>/dev/null from gh api and jq commands, allowing errors from these operations to be visible and aid in debugging.
Changelog
  • .agents/scripts/profile-readme-helper.sh
    • Added _sanitize_md and _sanitize_url helper functions to enhance security.
    • Consolidated multiple jq calls for user profile data into a single pass and applied new sanitization functions to user-controlled fields like display name, bio, blog URL, and Twitter username.
    • Removed 2>/dev/null from gh api and jq commands to make errors visible.
    • Refactored the generation of the 'own repos' section to use a single jq pass, eliminating per-row jq invocations.
    • Implemented parallel fetching of fork parent URLs using xargs -P 6 to improve performance for the 'contributions' section.
    • Ensured proper newline handling for the 'Projects' section output by changing printf '%s' to printf '%s\n'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b91740fc-99e9-43de-a031-4726f6d193c5

📥 Commits

Reviewing files that changed from the base of the PR and between 198e0b1 and db17968.

📒 Files selected for processing (1)
  • .agents/scripts/profile-readme-helper.sh

Walkthrough

The script now sanitizes markdown and URL inputs to prevent breaking characters, consolidates multiple jq invocations into single batch operations for efficiency, and implements parallel API calls (up to 6 concurrent) when processing fork contributions. Repository data gathering is refactored from per-item loops to bulk jq processing.

Changes

Cohort / File(s) Summary
Input Sanitization Functions
.agents/scripts/profile-readme-helper.sh
Adds _sanitize_md() to strip markdown-breaking characters and backticks, and _sanitize_url() to validate HTTP(S)-only URLs. Prevents malformed markdown and invalid link injection.
Data Gathering Consolidation
.agents/scripts/profile-readme-helper.sh
Refactors _generate_rich_readme to fetch user profile fields (display_name, bio, blog, twitter) in a single jq pass instead of multiple extractions. Applies sanitization to display_name and bio; validates blog URLs; strips invalid characters from twitter handle.
Repository Batch Processing
.agents/scripts/profile-readme-helper.sh
Replaces per-repository loops with single jq invocation to generate own repos as Markdown list items. Refactors fork/contributions to fetch fork names in bulk, then query parent URLs with parallel processing (up to 6 concurrent requests) before building contributions list.
Output Formatting & Languages
.agents/scripts/profile-readme-helper.sh
Consolidates language computation from repos into single jq invocation. Enhances blog display by sanitizing badge title while preserving link. Ensures Projects section maintains correct newline separators in generated Markdown.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

bug

Poem

🔄 Batches dance where loops once crawled,
Parallel pipes answer the call,
Sanitized streams keep the markdown clean,
One jq pass paints the scene,
DevOps dreams, optimized tall!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: addressing code review feedback from Gemini on profile README generation script.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/profile-readme-review-feedback

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 395 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 05:45:36 UTC 2026: Code review monitoring started
Mon Mar 9 05:45:36 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 395

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 395
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 05:45:39 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the performance and security of the profile README generation script by consolidating jq calls, parallel fetching of API data, and introducing sanitization functions for user-controlled input. However, the current sanitization logic has gaps, including a loose URL validation regex that allows for markdown injection, vulnerability to field-shifting attacks due to tab delimiters for user-controlled data, and unsanitized embedding of user-controlled fields like repository names and descriptions in the markdown output. Additionally, issues were identified concerning error suppression, which has been clarified with relevant rules, and a small formatting bug.

Comment on lines +741 to +743
fork_details=$(echo "$fork_names" | xargs -P 6 -I{} gh api "repos/${gh_user}/{}" --jq '
"\(.name)\t\(.description // "No description")\t\(.parent.html_url // .html_url)"
' 2>/dev/null || true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While the parallel fetching of fork details is a great performance improvement, redirecting stderr to /dev/null is generally discouraged as it can hide important errors. For instance, if gh api fails due to authentication issues, the error message will be suppressed, making it difficult to debug why the contributions section might be empty. It's better to allow these errors to be visible for debugging purposes. The || true already prevents the script from exiting on failure if set -e is enabled.

Suggested change
fork_details=$(echo "$fork_names" | xargs -P 6 -I{} gh api "repos/${gh_user}/{}" --jq '
"\(.name)\t\(.description // "No description")\t\(.parent.html_url // .html_url)"
' 2>/dev/null || true)
fork_details=$(echo "$fork_names" | xargs -P 6 -I{} gh api "repos/${gh_user}/{}" --jq '
"\(.name)\t\(.description // "No description")\t\(.parent.html_url // .html_url)"
' || true)
References
  1. Avoid using '2>/dev/null' for blanket suppression of command errors in shell scripts to ensure that authentication, syntax, or system issues remain visible for debugging.
  2. In shell scripts with 'set -e' enabled, use '|| true' to prevent the script from exiting when a command like 'jq' fails on an optional lookup. Do not suppress stderr with '2>/dev/null' so that actual syntax or system errors remain visible for debugging.

_sanitize_url() {
local url="$1"
# Only allow http:// and https:// schemes
if [[ "$url" =~ ^https?:// ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The _sanitize_url function uses a loose regex ^https?:// to validate URLs. It only checks if the string starts with http:// or https://, but does not validate the rest of the string. An attacker can append markdown-breaking characters (like )) followed by malicious markdown or javascript: URIs. For example, a blog URL like https://example.com) [click me](javascript:alert(1)) would pass this check and result in an injected link in the generated README.

Suggested change
if [[ "$url" =~ ^https?:// ]]; then
if [[ "$url" =~ ^https?://[^[:space:]\(\)\[\]]+$ ]]; then

Comment on lines +688 to +695
IFS=$'\t' read -r display_name bio blog twitter < <(
echo "$user_json" | jq -r '[
(.name // ""),
(.bio // ""),
(if .blog != null and .blog != "" then .blog else "" end),
(if .twitter_username != null and .twitter_username != "" then .twitter_username else "" end)
] | join("\t")' || printf '\t\t\t\n'
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The script uses tab characters as delimiters when processing data from the GitHub API. Since fields like bio and description are user-controlled and can contain tabs, an attacker can inject tabs to shift fields and control variables like blog or rurl. This can be used to bypass sanitization or inject malicious URLs into the markdown output. Consider sanitizing user-controlled fields for the delimiter character (tab) before joining them in jq.

local own_repos
own_repos=$(echo "$repos_json" | jq -r --arg user "$gh_user" '
[.[] | select(.fork == false and .name != $user)] |
map("- **[\(.name)](\(.html_url))** -- \(.description // "No description")") |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Repository names and descriptions are not sanitized before being embedded in the markdown output. While the PR adds sanitization for display_name and bio, it misses these other user-controlled fields, allowing for markdown injection. An attacker could name a repository or set its description to include markdown that alters the layout of the profile or includes malicious links.

Suggested change
map("- **[\(.name)](\(.html_url))** -- \(.description // "No description")") |
map("- **[\(.name | gsub(\"[\\[\\]()]\"; \"\"))](\(.html_url))** -- \(.description // \"No description\" | gsub(\"[\\[\\]()]\"; \"\"))") |
References
  1. Prefer using URLs provided directly in API responses (e.g., 'html_url', 'web_url') instead of manually constructing them via string concatenation to ensure robustness.

' 2>/dev/null || true)
while IFS=$'\t' read -r rname rdesc rurl; do
[[ -z "$rname" ]] && continue
contrib_repos="${contrib_repos}- **[${rname}](${rurl})** -- ${rdesc}"$'\n'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Repository names and descriptions for forks are not sanitized before being embedded in the markdown output. This allows for markdown injection from user-controlled repository data.

Suggested change
contrib_repos="${contrib_repos}- **[${rname}](${rurl})** -- ${rdesc}"$'\n'
contrib_repos="${contrib_repos}- **[$(_sanitize_md "${rname}")](${rurl})** -- $(_sanitize_md "${rdesc}")"$'\n'
References
  1. Prefer using URLs provided directly in API responses (e.g., 'html_url', 'web_url') instead of manually constructing them via string concatenation to ensure robustness.

echo "## Projects"
echo ""
printf '%s' "$own_repos"
printf '%s\n' "$own_repos"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The jq command used to populate $own_repos already produces output with a trailing newline. Using printf '%s\n' adds an extra newline, which will result in an unwanted blank line in the generated README file after the list of projects. The original printf '%s' was correct in this context.

Suggested change
printf '%s\n' "$own_repos"
printf '%s' "$own_repos"

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.agents/scripts/profile-readme-helper.sh (2)

665-677: Consider case-insensitive scheme matching.

The regex ^https?:// is case-sensitive. While rare, URLs with uppercase schemes (e.g., HTTPS://example.com) would be rejected and return empty.

♻️ Optional: Add case-insensitivity
 _sanitize_url() {
 	local url="$1"
+	# Convert to lowercase for scheme check
+	local url_lower="${url,,}"
 	# Only allow http:// and https:// schemes
-	if [[ "$url" =~ ^https?:// ]]; then
+	if [[ "$url_lower" =~ ^https?:// ]]; then
 		echo "$url"
 	else

Note: ${url,,} requires bash 4.0+. If bash 3.2 compatibility is needed, use $(echo "$url" | tr '[:upper:]' '[:lower:]') for the check only.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/profile-readme-helper.sh around lines 665 - 677, The scheme
check in _sanitize_url uses a case-sensitive regex (^https?://) which will
reject uppercase schemes like HTTPS://; update the validation to perform a
case-insensitive match (or normalize the scheme to lowercase before testing) so
_sanitize_url accepts any capitalization of http/https, e.g. use a
case-insensitive regex or convert "$url" to lowercase for the check while still
returning the original URL on success.

707-707: Consider adding --paginate for users with >100 repos.

The API call uses per_page=100 but no pagination. Users with more than 100 repositories would have incomplete project/contribution lists. Sibling scripts in this repo (e.g., review-bot-gate-helper.sh) use --paginate for API calls returning lists.

♻️ Add pagination support
-	repos_json=$(gh api "users/${gh_user}/repos?per_page=100&sort=updated") || repos_json="[]"
+	repos_json=$(gh api "users/${gh_user}/repos?per_page=100&sort=updated" --paginate) || repos_json="[]"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/profile-readme-helper.sh at line 707, The gh API call that
populates repos_json currently requests per_page=100 without pagination, so
users with >100 repos will be missing results; update the call used to set
repos_json (the gh api invocation that currently builds
"users/${gh_user}/repos?per_page=100&sort=updated") to use gh's --paginate
option (or otherwise loop through pages) so all repositories are retrieved
instead of only the first 100; ensure any error fallback (repos_json="[]") and
subsequent code that consumes repos_json continue to work with the paginated
output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/scripts/profile-readme-helper.sh:
- Around line 739-743: The parallel fetch for fork_details currently swallows
all API errors via "2>/dev/null || true" and doesn't sanitize .description;
update the gh api call (repos/${gh_user}/{}) to capture and surface errors
instead of redirecting stderr to /dev/null (e.g., log failures to stderr or
collect stderr to a temp file while allowing the loop to continue) and remove
the "|| true" swallow so failures are visible; also apply the same markdown/HTML
sanitization used in the own_repos section to the .description field produced by
the jq expression (the ".description" in the jq output) to prevent markdown
injection.
- Around line 726-732: The repo descriptions in the own_repos generation are not
sanitized, allowing markdown injection; update the jq filter used in the
own_repos assignment (the jq call that reads repos_json with --arg user
"$gh_user") to sanitize .description before embedding it (e.g. replace or escape
characters that break Markdown links like "]", "(", ")" and backticks using jq's
gsub or a small sanitize filter), and keep the fallback to "No description"
(i.e., map("- **[\(.name)](\(.html_url))** -- \(.description // \"No
description\")") should become something like mapping that applies the sanitize
filter to .description so the output is safe). Ensure you modify the own_repos
variable generation and keep gh_user and repos_json usage unchanged.

---

Nitpick comments:
In @.agents/scripts/profile-readme-helper.sh:
- Around line 665-677: The scheme check in _sanitize_url uses a case-sensitive
regex (^https?://) which will reject uppercase schemes like HTTPS://; update the
validation to perform a case-insensitive match (or normalize the scheme to
lowercase before testing) so _sanitize_url accepts any capitalization of
http/https, e.g. use a case-insensitive regex or convert "$url" to lowercase for
the check while still returning the original URL on success.
- Line 707: The gh API call that populates repos_json currently requests
per_page=100 without pagination, so users with >100 repos will be missing
results; update the call used to set repos_json (the gh api invocation that
currently builds "users/${gh_user}/repos?per_page=100&sort=updated") to use gh's
--paginate option (or otherwise loop through pages) so all repositories are
retrieved instead of only the first 100; ensure any error fallback
(repos_json="[]") and subsequent code that consumes repos_json continue to work
with the paginated output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5226320c-0f8b-4fc5-a1cb-a4660b1cad3f

📥 Commits

Reviewing files that changed from the base of the PR and between 4528348 and 198e0b1.

📒 Files selected for processing (1)
  • .agents/scripts/profile-readme-helper.sh

- Remove 2>/dev/null from xargs fork fetch (|| true suffices)
- Tighten _sanitize_url to reject markdown-breaking chars in URLs
  using glob patterns (bash regex [^...] with escaped parens is
  unreliable across bash versions)
- Strip tabs/newlines from jq user profile output to prevent
  tab-delimiter injection in bio/description fields
- Sanitize repo names and descriptions in both own repos (jq gsub)
  and fork repos (_sanitize_md) before markdown embedding
- Keep printf '%s\n' for own_repos (bash $() strips trailing
  newlines, so the explicit \n is needed for section spacing)

Ref: PR #3963 review comments from gemini-code-assist
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 395 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 05:53:51 UTC 2026: Code review monitoring started
Mon Mar 9 05:53:52 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 395

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 395
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 05:53:54 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2026

@marcusquinn marcusquinn merged commit 3c35b1c into main Mar 9, 2026
12 checks passed
@marcusquinn marcusquinn deleted the fix/profile-readme-review-feedback branch March 9, 2026 05:57
marcusquinn added a commit that referenced this pull request Mar 10, 2026
#3963 review feedback

Fixes remaining findings from coderabbit and gemini reviewers:

- Add backtick stripping to jq gsub sanitization for own_repos names and
  descriptions (markdown injection via backticks)
- Add backtick stripping to fork_details jq sanitization for consistency
- Fix jq operator precedence: wrap (.description // "No description") in
  parens so gsub applies to the actual description, not just the fallback
- Revert printf '%s\n' to printf '%s' for own_repos output (jq already
  includes trailing newline; extra newline caused blank line in README)
- Make _sanitize_url scheme check case-insensitive (accepts HTTPS://)
- Add --paginate to gh api repos fetch for users with >100 repos
- Validate fork parent URLs with _sanitize_url before markdown embedding

Closes #3984
marcusquinn added a commit that referenced this pull request Mar 10, 2026
…iew feedback (#4034)

* fix: address remaining quality-debt in profile-readme-helper.sh from PR #3963 review feedback

Fixes remaining findings from coderabbit and gemini reviewers:

- Add backtick stripping to jq gsub sanitization for own_repos names and
  descriptions (markdown injection via backticks)
- Add backtick stripping to fork_details jq sanitization for consistency
- Fix jq operator precedence: wrap (.description // "No description") in
  parens so gsub applies to the actual description, not just the fallback
- Revert printf '%s\n' to printf '%s' for own_repos output (jq already
  includes trailing newline; extra newline caused blank line in README)
- Make _sanitize_url scheme check case-insensitive (accepts HTTPS://)
- Add --paginate to gh api repos fetch for users with >100 repos
- Validate fork parent URLs with _sanitize_url before markdown embedding

Closes #3984

* fix: suppress SC2016 for intentional backtick in jq gsub pattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant