-
Notifications
You must be signed in to change notification settings - Fork 3
chore(workflows): Simplify sync-docs-from-node workflow #257
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
Conversation
…input instead of source branch and tag
… version parameter
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThis update refactors two GitHub Actions workflow files to consolidate and standardize versioning parameters. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/sync-docs-from-node.yml (2)
81-86: Token fallback is fine – but checkout may silently fail if both tokens are unset
actions/checkout@v4fails only after attempting auth. A short pre-check avoids wasted minutes:-token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }} +token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }} +# Fail fast if neither secret is present +if: ${{ (secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN) != '' }}Alternatively, abort earlier inside a small shell step.
519-523: Commit message generation relies on multi-line quoting – fragile on POSIX sh
git commit -m "<multiline>"is legal but some shells collapse newlines in double-quoted strings.
Use the standard two-flag form to guarantee formatting:-git commit -m "docs: Sync documentation from node repository ${{ steps.params.outputs.version }} - - - Source: genlayerlabs/genlayer-node@${{ steps.params.outputs.version }} - - Version: ${{ steps.params.outputs.version }} - ..." +git commit \ + -m "docs: Sync documentation from node repository ${{ steps.params.outputs.version }}" \ + -m "- Source: genlayerlabs/genlayer-node@${{ steps.params.outputs.version }}" \ + -m "- Version: ${{ steps.params.outputs.version }}" \ + -m "- Total changes: ${{ steps.check_changes.outputs.total_changes }}" \ + -m "- Added: ${{ steps.check_changes.outputs.total_added }} files" \ + -m "- Updated: ${{ steps.check_changes.outputs.total_updated }} files" \ + -m "- Deleted: ${{ steps.check_changes.outputs.total_deleted }} files"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.claude/prs/chore-nod-189-ci-automate-changelog.md(1 hunks).github/workflows/sync-docs-from-node.yml(7 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
.claude/prs/chore-nod-189-ci-automate-changelog.md (3)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (6)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - genlayer-docs
- GitHub Check: Header rules - genlayer-docs
- GitHub Check: Pages changed - genlayer-docs
🔇 Additional comments (3)
.github/workflows/sync-docs-from-node.yml (2)
8-10: 👍 Input consolidation looks correctThe new
versioninput cleanly replaces the earliersource_branch/tagpair and is declared as required, preventing accidental empty runs.
No concerns here.
603-604: PR title string is goodTitle correctly embeds the new
versionvalue; no action needed..claude/prs/chore-nod-189-ci-automate-changelog.md (1)
1-6: Documentation note is clear and conciseThe changelog entry accurately reflects the workflow change. Nothing to add.
…s-from-node workflow
…e in sync-docs-from-node workflow
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/sync-docs-from-node.yml (3)
74-79: Avoid duplicating default path values – keep single source of truthThe defaults for
changelog_path,api_gen_path,api_debug_path, and their regex counterparts are now hard-coded twice: once in theworkflow_dispatch.inputsblock (lines 8-26) and again in this bash extraction (lines 68-79). If one side is updated but the other is forgotten the workflow silently diverges.A lighter-maintenance pattern is to rely on the input default that GitHub already expands:
-echo "changelog_path=docs/changelog" >> $GITHUB_OUTPUT -echo "api_gen_path=${{ github.event.inputs.api_gen_path || 'docs/api/rpc/gen' }}" >> $GITHUB_OUTPUT -echo "api_debug_path=${{ github.event.inputs.api_debug_path || 'docs/api/rpc/debug' }}" >> $GITHUB_OUTPUT -echo "api_gen_regex=${{ github.event.inputs.api_gen_regex || 'gen_(?!dbg_).*' }}" >> $GITHUB_OUTPUT -echo "api_debug_regex=${{ github.event.inputs.api_debug_regex || 'gen_dbg_.*' }}" >> $GITHUB_OUTPUT +echo "changelog_path=${{ github.event.inputs.changelog_path }}" >> $GITHUB_OUTPUT +echo "api_gen_path=${{ github.event.inputs.api_gen_path }}" >> $GITHUB_OUTPUT +echo "api_debug_path=${{ github.event.inputs.api_debug_path }}" >> $GITHUB_OUTPUT +echo "api_gen_regex=${{ github.event.inputs.api_gen_regex }}" >> $GITHUB_OUTPUT +echo "api_debug_regex=${{ github.event.inputs.api_debug_regex }}" >> $GITHUB_OUTPUTThis way the default lives only in the
inputs:stanza, eliminating drift.Also applies to: 68-70
62-67: Tiny robustness tweak for the null-safe checkGood call adding an early guard 👍. To stay consistent with previous guidance (see past review), consider keeping the null-coalescing fallback so the expression never errors if
versionis omitted entirely:-if [ -z "${{ github.event.client_payload.version }}" ]; then +if [ -z "${{ github.event.client_payload.version || '' }}" ]; thenNot critical, but prevents an Action-level “property doesn’t exist” failure.
96-99: Broaden sanitisation ofversion→ branch nameOnly replacing slashes still allows other characters (
:, spaces,~, etc.) that git refuses in ref names.-VERSION="${{ steps.params.outputs.version }}" -SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +VERSION="${{ steps.params.outputs.version }}" +# Replace anything that is *not* alphanum, dot or hyphen +SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9_.-' '-' )Keeps refs valid regardless of how external systems name their tags.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(7 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (5)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - genlayer-docs
- GitHub Check: Header rules - genlayer-docs
- GitHub Check: Pages changed - genlayer-docs
🔇 Additional comments (1)
.github/workflows/sync-docs-from-node.yml (1)
84-87: Fetch full history to ensure tag checkout reliability
actions/checkout@v4does not fetch tags whenfetch-depthis left at the default (1).
Ifversionpoints to a lightweight tag the step may resolve an empty ref and fail.-uses: actions/checkout@v4 +uses: actions/checkout@v4 with: repository: genlayerlabs/genlayer-node ref: ${{ steps.params.outputs.version }} + fetch-depth: 0 # fetch tags/branches reliablyThis adds a negligible cost (<1 s on GH runners) and removes an intermittent failure mode.
… sync-docs-from-node workflow
… with PCRE support
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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.github/workflows/sync-docs-from-node.yml (3)
96-103: Sanitisation covers “/” but not Git ref prefixesIf
versionarrives as a full ref (refs/tags/v0.3.5) or with spaces, the branch name will still break. Consider a more defensive scrub:-VERSION="${{ steps.params.outputs.version }}" -SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +VERSION="${{ steps.params.outputs.version }}" +SAFE_VERSION=$(echo "$VERSION" \ + | sed -e 's#^refs/[^/]*/##' \ # strip refs/heads|tags/ + -e 's/[^A-Za-z0-9._-]/-/g') # replace anything unsafe
258-274:matches_patternduplicated – extract onceThe identical
matches_pattern()helper is defined twice. Re-declare once near the top of the script (or source a reusable shell file) and call it from both sync blocks to keep things DRY and avoid future divergence.Also applies to: 392-407
100-106: Trailing whitespace flagged by YAML-lintYAML-lint errors show multiple trailing-space violations (lines ~100, 106, 257, 269, 347, 391, 397, 403, 481). Strip them to keep the workflow lint-clean.
-printf "- Deleted: \`%s\`\n" "$(basename "$dest_file")" >> $SYNC_REPORT␠ +printf "- Deleted: \`%s\`\n" "$(basename "$dest_file")" >> $SYNC_REPORTAlso applies to: 257-269, 347-351, 391-407, 481-485
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(15 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (6)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 106-106: trailing spaces
(trailing-spaces)
[error] 257-257: trailing spaces
(trailing-spaces)
[error] 263-263: trailing spaces
(trailing-spaces)
[error] 269-269: trailing spaces
(trailing-spaces)
[error] 347-347: trailing spaces
(trailing-spaces)
[error] 391-391: trailing spaces
(trailing-spaces)
[error] 397-397: trailing spaces
(trailing-spaces)
[error] 403-403: trailing spaces
(trailing-spaces)
[error] 481-481: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - genlayer-docs
- GitHub Check: Header rules - genlayer-docs
- GitHub Check: Pages changed - genlayer-docs
🔇 Additional comments (2)
.github/workflows/sync-docs-from-node.yml (2)
61-68: Early guard forversionis solid – prevents cryptic failures.The explicit check and hard-fail when
client_payload.versionis missing closes the gap called out in earlier reviews. ✅
86-88: Fallback token may still be empty for private forks
secrets.GITHUB_TOKENonly has cross-repo read on public repos. Ifgenlayer-nodeis private andNODE_REPO_TOKENis not set, the checkout will receive an empty string and silently fall back toactions/checkout’s unauthenticated mode → checkout of a private repo will fail.token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }}Add a guard similar to the
versioncheck:if [ -z "${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }}" ]; then echo "❌ Missing NODE_REPO_TOKEN (and GITHUB_TOKEN is insufficient for private repo)" >&2 exit 1 fi
…ath for missing source config file
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/sync-docs-from-node.yml (1)
569-570:git addfails when any listed directory is missing → broken workflow.The previous review flagged this but the brittle command remains.
-git add content/validators pages/api-references pages/validators +git add -A # add *whatever* changedAlternatively, loop and add only existing paths.
Not fixing this means a no-op sync (e.g. only API docs changed) aborts with “fatal: pathspec… did not match any files”.
🧹 Nitpick comments (3)
.github/workflows/sync-docs-from-node.yml (3)
96-106: Branch-name sanitisation still allows illegal Git ref characters (space, ~, ^, :, ?).Replacing slashes is a good start, but Git forbids several other bytes. A single liner covers all:
-SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +# Replace all chars disallowed by Git refs with ‘-’ +SAFE_VERSION=$(echo "$VERSION" | tr ' ~^:?*[]' '-' | sed 's#/##g')Prevents accidental ref creation failures.
256-274:matches_patternduplicated in two steps – factor out or source once.The identical Bash function is defined in both API-sync steps. While harmless, duplication is noise and a maintenance hotspot.
Minimal change: move the function into an earlier step (e.g. a small
preparestep that exports it) andsourceit in the later scripts, or extract to.github/scripts/match.sh.
1-672: Trim trailing whitespace – YAMLlint complaining.Multiple lines flagged (100, 106, 258, …).
-printf "- Deleted: \`%s\`\n" "$(basename "$dest_file")" >> $SYNC_REPORT␠ +printf "- Deleted: \`%s\`\n" "$(basename "$dest_file")" >> $SYNC_REPORTRun
sed -i 's/[ \t]*$//' .github/workflows/sync-docs-from-node.ymlor letprettierhandle it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (8)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 106-106: trailing spaces
(trailing-spaces)
[error] 258-258: trailing spaces
(trailing-spaces)
[error] 264-264: trailing spaces
(trailing-spaces)
[error] 270-270: trailing spaces
(trailing-spaces)
[error] 348-348: trailing spaces
(trailing-spaces)
[error] 392-392: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 404-404: trailing spaces
(trailing-spaces)
[error] 482-482: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
.github/workflows/sync-docs-from-node.yml (1)
596-597: 👍 Safer push with--force-with-lease.
Protects against remote rewrites while still replacing the branch.
…e config file message
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.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/sync-docs-from-node.yml (2)
570-571:git addaborts when any listed directory is missing
git add content/validators pages/api-references pages/validatorsfails if,
say,pages/validatorsdoesn’t exist. Use a safer pattern:-git add content/validators pages/api-references pages/validators +git add -A # or guard each dir exists
61-68: Guard still fails whenversionis the literal string"null"GitHub replaces an absent JSON key with the string
null, not an empty string.
[ -z "${{ github.event.client_payload.version }}" ]therefore passes, but later uses of the variable abort underset -u.- if [ -z "${{ github.event.client_payload.version }}" ]; then +raw_version='${{ github.event.client_payload.version }}' +# treat both empty and "null" as missing +if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then
🧹 Nitpick comments (3)
.github/workflows/sync-docs-from-node.yml (3)
257-275:matches_patternfunction duplicated – extract to a reusable stepThe identical Bash function appears in both sync blocks, increasing maintenance
cost. A composite action or a small reusable script committed to the repo would
eliminate duplication and keep behaviour in one place.Also applies to: 394-409
571-578: Multi-line commit message inside one-mcan break quotingThe single
-moption wraps the entire heredoc-like block; if an unescaped
"slips into any interpolated value the commit will fail. Prefer two-m
flags or a here-doc:git commit -F- <<EOF docs: Sync documentation from node repository ${{ steps.params.outputs.version }} ... EOF
1-673: Trailing spaces flagged by YAMLlintLines 100, 106, 259, 265, 271, 349, 393, 399, 405 & 483 contain trailing
whitespace. Fix to keep the workflow lint-clean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (8)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 106-106: trailing spaces
(trailing-spaces)
[error] 259-259: trailing spaces
(trailing-spaces)
[error] 265-265: trailing spaces
(trailing-spaces)
[error] 271-271: trailing spaces
(trailing-spaces)
[error] 349-349: trailing spaces
(trailing-spaces)
[error] 393-393: trailing spaces
(trailing-spaces)
[error] 399-399: trailing spaces
(trailing-spaces)
[error] 405-405: trailing spaces
(trailing-spaces)
[error] 483-483: trailing spaces
(trailing-spaces)
| # Sanitize version string for use in branch name | ||
| VERSION="${{ steps.params.outputs.version }}" | ||
| SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') # replace any '/' with '-' | ||
| BRANCH_NAME="docs/node/${SAFE_VERSION}" | ||
|
|
||
| # Check if branch exists on remote | ||
| if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then | ||
| echo "Branch $BRANCH_NAME already exists on remote, will force update" | ||
| git fetch origin "$BRANCH_NAME" | ||
| fi |
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.
🛠️ Refactor suggestion
Sanitisation incomplete – still allows spaces and other unsafe chars
Replacing / with - fixes path-like refs, but branch names may still contain
whitespace or exotic Unicode if a bad version is dispatched. Consider:
-SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g')
+SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-]' '-' | sed 's/^-*//;s/-*$//')This retains only safe characters and collapses runs of invalid ones to a
single -.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Sanitize version string for use in branch name | |
| VERSION="${{ steps.params.outputs.version }}" | |
| SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') # replace any '/' with '-' | |
| BRANCH_NAME="docs/node/${SAFE_VERSION}" | |
| # Check if branch exists on remote | |
| if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then | |
| echo "Branch $BRANCH_NAME already exists on remote, will force update" | |
| git fetch origin "$BRANCH_NAME" | |
| fi | |
| # Sanitize version string for use in branch name | |
| VERSION="${{ steps.params.outputs.version }}" | |
| - SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') # replace any '/' with '-' | |
| + SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-]' '-' | sed 's/^-*//;s/-*$//') | |
| BRANCH_NAME="docs/node/${SAFE_VERSION}" | |
| # Check if branch exists on remote | |
| if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then | |
| echo "Branch $BRANCH_NAME already exists on remote, will force update" | |
| git fetch origin "$BRANCH_NAME" | |
| fi |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 100-100: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents
In .github/workflows/sync-docs-from-node.yml around lines 96 to 105, the current
sanitization only replaces '/' with '-', which still allows spaces and other
unsafe characters in the branch name. Update the sanitization step to remove or
replace all unsafe characters by retaining only safe characters (e.g.,
alphanumerics, dots, dashes) and collapsing sequences of invalid characters into
a single '-'. This ensures the branch name is valid and safe for git operations.
…tency in sync-docs-from-node workflow
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.
Actionable comments posted: 1
♻️ Duplicate comments (3)
.github/workflows/sync-docs-from-node.yml (3)
96-100: Sanitisation still allows space / Unicode chars – can break branch namesOnly replacing slashes is insufficient. Consider the more robust filter already
proposed in the earlier review:-VERSION="${{ steps.params.outputs.version }}" -SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +VERSION="${{ steps.params.outputs.version }}" +# keep [A–Z a–z 0–9 . _ -] collapse others to '-' +SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-' '-' | sed 's/^-*//;s/-*$//')
570-571:git addfails when a listed path is absent (issue still unresolved)Previous review noted this; the command is unchanged and will abort if, for
example,pages/validatorshas been deleted.
Usegit add -Aor conditional checks.
62-68: Guard also against literalnullto avoid silent failures
github.event.client_payload.versionresolves to the stringnullwhen the key is absent.
[ -z "null" ]is false, so the workflow continues and later checkout receives an invalid ref, reproducing the very bug this block is meant to prevent.-if [ -z "${{ github.event.client_payload.version }}" ]; then +raw_version='${{ github.event.client_payload.version }}' +# Treat missing or literal "null" the same +if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then
🧹 Nitpick comments (2)
.github/workflows/sync-docs-from-node.yml (2)
165-166: Minor: mixedecho/printf– pick one styleYou switched one deletion log line to
printfbut the rest of the file still
usesecho. For consistency (and to avoid future lint noise) adopt a single
style across the script.
259-275: Function duplication – extract once to.github/scripts/lib.sh
matches_pattern()is declared twice (gen/debug). Duplicated code increases
maintenance cost; a tiny helper shell script sourced in both steps avoids this.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (8)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkout@v4 is sparse-checkout-cone-mode (not sparse-checkout-cone). This parameter should be set to true to enable cone mode for directory-based sparse checkout optimization.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 106-106: trailing spaces
(trailing-spaces)
[error] 259-259: trailing spaces
(trailing-spaces)
[error] 265-265: trailing spaces
(trailing-spaces)
[error] 271-271: trailing spaces
(trailing-spaces)
[error] 349-349: trailing spaces
(trailing-spaces)
[error] 393-393: trailing spaces
(trailing-spaces)
[error] 399-399: trailing spaces
(trailing-spaces)
[error] 405-405: trailing spaces
(trailing-spaces)
[error] 483-483: trailing spaces
(trailing-spaces)
…-docs-from-node workflow
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/workflows/sync-docs-from-node.yml (4)
62-68: Guard still fails whenversionis literallynullIf the dispatch payload omits the
versionkey entirely, the expression${{ github.event.client_payload.version }}is rendered as the literal stringnull.
Withset -uenabled, later uses of$VERSION(e.g. ingit checkout) will abort the script becausenullis not empty and does not point to a valid ref.-VERSION="${{ github.event.client_payload.version }}" -if [ -z "$VERSION" ]; then - VERSION="latest" -fi +raw_version='${{ github.event.client_payload.version }}' +# Treat "null" as unset +if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then + VERSION="latest" +else + VERSION="$raw_version" +fi
85-89:NODE_REPO_TOKEN || GITHUB_TOKENfallback is still invalid for secretsGitHub Actions treats an unset secret as a hard error – the whole job fails before the step even starts.
The safe pattern is to reference one secret and ensure it is always defined (e.g. setNODE_REPO_TOKENin the repo to the same value asGITHUB_TOKENif a dedicated token is not provided).- token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }} + token: ${{ secrets.NODE_REPO_TOKEN }}
134-137: Branch-name sanitisation still allows unsafe charactersOnly
/is replaced, so spaces or other invalid ref characters can still sneak through, creating refs Git refuses to push.Consider the more comprehensive pattern previously suggested:
-SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-]' '-' | sed 's/^-*//;s/-*$//')
626-627:git addaborts when any listed directory is absentIf, for example,
pages/validatorsdoesn’t exist in this PR,git addexits non-zero and the workflow stops.
Use a safer variant:-git add content/validators pages/api-references pages/validators +git add -A
🧹 Nitpick comments (3)
.github/workflows/sync-docs-from-node.yml (3)
318-331: Possible pattern-injection & globbing issues inmatches_pattern
$patterncomes from user input and is inserted directly into the Perl one-liner inside double quotes.
A malicious pattern could break the command or execute arbitrary Perl code. At a minimum, wrap the variable in single quotes and pass it via-e:-echo "$filename" | perl -ne "exit 0 if /^($pattern)\$/; exit 1" +perl -e 'exit 0 if shift =~ /^('"$pattern"')$/; exit 1' -- "$filename"Also quote
$patternin thegrepfallback:-echo "$filename" | grep -E "^($pattern)$" >/dev/null 2>&1 +echo "$filename" | grep -E "^(${pattern})$" >/dev/null 2>&1
451-465: Duplicatematches_patternimplementation – consider reuseThe identical function is duplicated for debug-method syncing. Move it to a reusable script or a preceding step and
sourceit to avoid divergence.
1-729: Trailing whitespace flagged by YAMLlintMultiple lines contain trailing spaces (see YAMLlint output).
While cosmetic, this fails stricter CI linters and can be fixed automatically withprettier --writeoryarn lint:fix.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 98-98: trailing spaces
(trailing-spaces)
[error] 103-103: trailing spaces
(trailing-spaces)
[error] 122-122: trailing spaces
(trailing-spaces)
[error] 137-137: trailing spaces
(trailing-spaces)
[error] 143-143: trailing spaces
(trailing-spaces)
[error] 240-240: trailing spaces
(trailing-spaces)
[error] 250-250: trailing spaces
(trailing-spaces)
[error] 256-256: trailing spaces
(trailing-spaces)
[error] 275-275: trailing spaces
(trailing-spaces)
[error] 315-315: trailing spaces
(trailing-spaces)
[error] 321-321: trailing spaces
(trailing-spaces)
[error] 327-327: trailing spaces
(trailing-spaces)
[error] 405-405: trailing spaces
(trailing-spaces)
[error] 449-449: trailing spaces
(trailing-spaces)
[error] 455-455: trailing spaces
(trailing-spaces)
[error] 461-461: trailing spaces
(trailing-spaces)
[error] 539-539: trailing spaces
(trailing-spaces)
…mmit process in sync-docs-from-node workflow
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/workflows/sync-docs-from-node.yml (4)
63-67: Missing"null"guard – still breaks whenversionkey is omittedPast review already highlighted that
${{ github.event.client_payload.version }}can be rendered as the literal stringnull.
The current check only treats an empty string as “unset”, soVERSION="null"slips through and leads to an invalid checkout ref.
86-88: Secret fallback with||is still unsafe
token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }}will explode ifNODE_REPO_TOKENis not defined because GitHub blocks access to an undefined secret before evaluating||.
The previously-suggested runtime fallback (store the same value in both secrets, or select in a shell step) has not been applied.
133-138: Branch-name sanitisation still only replaces “/”The replacement fixes path-like refs but still allows spaces and other illegal characters.
Prior review proposed retaining[A-Za-z0-9._-]only and collapsing invalid runs to “-”.Example patch:
-VERSION="${{ steps.set_version.outputs.version }}" -SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +RAW_VERSION="${{ steps.set_version.outputs.version }}" +SAFE_VERSION=$(echo "$RAW_VERSION" | tr -c 'A-Za-z0-9._-' '-' | sed 's/^-*//;s/-*$//')
662-670:git addfails when any listed directory is absent
git add content/validators pages/api-references pages/validatorsaborts the commit if one of the paths does not exist.
Safer options previously suggested (e.g.git add -Aor conditional adds) remain unimplemented.
🧹 Nitpick comments (2)
.github/workflows/sync-docs-from-node.yml (2)
352-367:matches_patternduplicated – extract once to avoid driftThe identical helper is declared twice (gen & debug sections).
Define it once (e.g. in an earlierrun:step andsourceit, or place it in a reusable action) to keep behaviour consistent and shrink the workflow.Also applies to: 486-501
95-103: Trailing whitespace trips YAML-lintMultiple changed lines contain stray spaces reported by YAML-lint.
Cleaning them up keeps CI green and the file tidy.Also applies to: 120-122, 137-143, 240-241
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(15 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 98-98: trailing spaces
(trailing-spaces)
[error] 103-103: trailing spaces
(trailing-spaces)
[error] 122-122: trailing spaces
(trailing-spaces)
[error] 137-137: trailing spaces
(trailing-spaces)
[error] 143-143: trailing spaces
(trailing-spaces)
[error] 240-240: trailing spaces
(trailing-spaces)
[error] 250-250: trailing spaces
(trailing-spaces)
[error] 256-256: trailing spaces
(trailing-spaces)
[error] 280-280: trailing spaces
(trailing-spaces)
[error] 286-286: trailing spaces
(trailing-spaces)
[error] 298-298: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 328-328: trailing spaces
(trailing-spaces)
[error] 351-351: trailing spaces
(trailing-spaces)
[error] 357-357: trailing spaces
(trailing-spaces)
[error] 363-363: trailing spaces
(trailing-spaces)
[error] 441-441: trailing spaces
(trailing-spaces)
[error] 485-485: trailing spaces
(trailing-spaces)
[error] 491-491: trailing spaces
(trailing-spaces)
[error] 497-497: trailing spaces
(trailing-spaces)
[error] 575-575: trailing spaces
(trailing-spaces)
[error] 667-667: trailing spaces
(trailing-spaces)
[error] 669-669: trailing spaces
(trailing-spaces)
[error] 676-676: trailing spaces
(trailing-spaces)
…mmit process in sync-docs-from-node workflow
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/workflows/sync-docs-from-node.yml (4)
69-73: Version handling needs improvement for repository_dispatch.The current logic doesn't handle the case where
client_payload.versionis missing or null from repository_dispatch events, which could cause issues downstream.Based on past review comments, this issue should have been addressed in commit e99f5b5, but the current code still shows the simplified version without the null check.
142-154: Branch name sanitization is incomplete.The current sanitization only replaces
/with-, but branch names could still contain other unsafe characters like spaces or special Unicode characters.Based on past review comments, this should have been addressed, but the current implementation still only handles forward slashes.
92-92: Token fallback pattern needs correction.The expression
${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }}will fail ifNODE_REPO_TOKENis not set, as GitHub Actions cannot access undefined secrets.Based on past review comments, this issue should have been addressed by using only
NODE_REPO_TOKENand setting it at the repository level.
739-739: Git add command may fail with missing paths.The command
git add content/validators pages/api-references pages/validatorswill fail if any of the specified directories don't exist or have no changes.Based on past review comments, this should be addressed by using a safer approach like
git add -Aor checking for directory existence before adding.
🧹 Nitpick comments (1)
.github/workflows/sync-docs-from-node.yml (1)
51-51: Remove trailing spaces throughout the file.YAMLlint has flagged multiple lines with trailing spaces, which should be cleaned up for consistency and to pass linting checks.
# Remove trailing spaces from all flagged lines # This can be done with: sed -i 's/[[:space:]]*$//' .github/workflows/sync-docs-from-node.ymlAlso applies to: 107-107, 112-112, 131-131, 145-145, 151-151, 248-248, 265-265, 271-271, 274-274, 281-281, 286-286, 293-293, 298-298, 308-308, 324-324, 339-339, 351-351, 371-371, 381-381, 404-404, 410-410, 416-416, 494-494, 538-538, 544-544, 550-550, 628-628, 678-678, 738-738, 740-740, 747-747
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/scripts/sanitize-config.py(1 hunks).github/workflows/sync-docs-from-node.yml(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 131-131: trailing spaces
(trailing-spaces)
[error] 145-145: trailing spaces
(trailing-spaces)
[error] 151-151: trailing spaces
(trailing-spaces)
[error] 248-248: trailing spaces
(trailing-spaces)
[error] 265-265: trailing spaces
(trailing-spaces)
[error] 271-271: trailing spaces
(trailing-spaces)
[error] 274-274: trailing spaces
(trailing-spaces)
[error] 281-281: trailing spaces
(trailing-spaces)
[error] 286-286: trailing spaces
(trailing-spaces)
[error] 293-293: trailing spaces
(trailing-spaces)
[error] 298-298: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 324-324: trailing spaces
(trailing-spaces)
[error] 339-339: trailing spaces
(trailing-spaces)
[error] 351-351: trailing spaces
(trailing-spaces)
[error] 371-371: trailing spaces
(trailing-spaces)
[error] 381-381: trailing spaces
(trailing-spaces)
[error] 404-404: trailing spaces
(trailing-spaces)
[error] 410-410: trailing spaces
(trailing-spaces)
[error] 416-416: trailing spaces
(trailing-spaces)
[error] 494-494: trailing spaces
(trailing-spaces)
[error] 538-538: trailing spaces
(trailing-spaces)
[error] 544-544: trailing spaces
(trailing-spaces)
[error] 550-550: trailing spaces
(trailing-spaces)
[error] 628-628: trailing spaces
(trailing-spaces)
[error] 678-678: trailing spaces
(trailing-spaces)
[error] 738-738: trailing spaces
(trailing-spaces)
[error] 740-740: trailing spaces
(trailing-spaces)
[error] 747-747: trailing spaces
(trailing-spaces)
🔇 Additional comments (13)
.github/scripts/sanitize-config.py (1)
15-15: Debug output enhancements look good.The added debug print statements provide excellent visibility into the sanitization process, which will be helpful for troubleshooting workflow issues. The output includes file paths, section discovery, and removal tracking without exposing sensitive configuration values.
Also applies to: 21-26, 28-28, 32-32, 35-35, 37-40, 46-46
.github/workflows/sync-docs-from-node.yml (12)
51-56: Python dependency installation is correctly placed.The Python dependencies setup is appropriately added before the Git configuration step, ensuring PyYAML is available for the config sanitization script.
8-11: Version parameter consolidation simplifies the workflow.The consolidation of separate
source_branchandtagparameters into a singleversionparameter with "latest" as default is a good improvement. The unified API paths todocs/api/rpcalso eliminate confusion.Also applies to: 15-15, 19-19, 75-76, 80-80, 82-83
100-115: Latest version detection logic is robust.The automatic detection of the latest semantic version tag using
git tag -l | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1is a solid approach. The error handling for when no tags are found is appropriate.
93-93: Fetch depth and sparse checkout optimization.Using
fetch-depth: 0to get all tags for version detection and sparse checkout for onlydocsandconfigsdirectories is an excellent optimization that reduces clone time and storage.Also applies to: 96-96
249-262: Extensive debug logging enhances troubleshooting.The comprehensive debug output for config sync operations provides excellent visibility into directory structure, file contents, and sanitization process. This will be invaluable for diagnosing sync issues.
Also applies to: 266-270, 282-297, 300-323, 325-339, 341-350, 372-380
288-292: Robust sed replacement with backup handling.The sed commands with backup file creation and cleanup handle cross-platform compatibility well. The URL replacement patterns correctly target the zksync configuration fields.
407-420: Perl-first regex matching with grep fallback is excellent.The
matches_patternfunction that prioritizesperlfor PCRE support (including negative lookahead) and falls back togrep -Eis a smart solution for handling complex regex patterns across different environments.Also applies to: 541-554
210-210: Consistent printf usage for safe string formatting.Using
printf -- "- Deleted: \%s`\n"instead ofecho` for formatted output is the correct approach to handle filenames that might start with dashes or contain special characters.Also applies to: 387-387, 402-402, 497-497, 536-536, 631-631
679-695: Final config verification adds valuable safety check.The comprehensive verification that checks for sensitive sections and TODO placeholders in the final config.yaml provides an important safety net to ensure sanitization worked correctly.
733-747: Git operation debugging improves transparency.The debug groups showing git status before and after staging operations, with specific checks for config.yaml files, will help diagnose commit-related issues.
748-752: Commit and PR messages correctly reference version.The updated commit messages and PR titles properly reference the consolidated
versionparameter instead of the oldtagorsource_branchparameters, maintaining consistency with the parameter consolidation.Also applies to: 801-801, 832-832
774-774: Force push with lease is the safe approach.Using
--force-with-leaseinstead of--forceprovides protection against accidentally overwriting changes made by others, which is the correct approach for automated workflows.
92c0dd7 to
2e9ab00
Compare
…anitization process
2e9ab00 to
fb48029
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/sync-docs-from-node.yml (2)
148-150: Branch sanitization is incomplete.The current sanitization only replaces '/' with '-', but as noted in previous reviews, this still allows spaces and other unsafe characters in branch names.
Consider the more comprehensive sanitization suggested in previous reviews:
-SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-' '-' | sed 's/^-*//;s/-*$//')This retains only safe characters and collapses runs of invalid ones to a single '-'.
804-804: Git add command may still fail with missing paths.As noted in previous reviews,
git add content/validators pages/api-references pages/validatorscan fail if any specified path doesn't exist. Consider usinggit add -Aor checking path existence first.
🧹 Nitpick comments (1)
.github/workflows/sync-docs-from-node.yml (1)
51-51: Clean up trailing spaces throughout the file.YAMLlint has flagged multiple lines with trailing spaces. While these don't affect functionality, they should be cleaned up for better code quality and to pass linting checks.
Run the following command to remove all trailing spaces:
sed -i 's/[[:space:]]*$//' .github/workflows/sync-docs-from-node.ymlAlso applies to: 107-107, 112-112, 131-131, 151-151, 157-157, 249-249, 255-255, 270-270, 275-275, 281-281, 284-284, 291-291, 296-296, 303-303, 308-308, 318-318, 334-334, 347-347, 355-355, 361-361, 367-367, 377-377, 389-389, 398-398, 419-419, 437-437, 445-445, 448-448, 469-469, 475-475, 481-481, 559-559, 603-603, 609-609, 615-615, 693-693, 743-743, 803-803, 805-805, 812-812, 856-856, 870-870
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/scripts/sanitize-config.py(1 hunks).github/workflows/sync-docs-from-node.yml(17 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 131-131: trailing spaces
(trailing-spaces)
[error] 151-151: trailing spaces
(trailing-spaces)
[error] 157-157: trailing spaces
(trailing-spaces)
[error] 249-249: trailing spaces
(trailing-spaces)
[error] 255-255: trailing spaces
(trailing-spaces)
[error] 270-270: trailing spaces
(trailing-spaces)
[error] 275-275: trailing spaces
(trailing-spaces)
[error] 281-281: trailing spaces
(trailing-spaces)
[error] 284-284: trailing spaces
(trailing-spaces)
[error] 291-291: trailing spaces
(trailing-spaces)
[error] 296-296: trailing spaces
(trailing-spaces)
[error] 303-303: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 334-334: trailing spaces
(trailing-spaces)
[error] 347-347: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 361-361: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 377-377: trailing spaces
(trailing-spaces)
[error] 389-389: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 419-419: trailing spaces
(trailing-spaces)
[error] 437-437: trailing spaces
(trailing-spaces)
[error] 445-445: trailing spaces
(trailing-spaces)
[error] 448-448: trailing spaces
(trailing-spaces)
[error] 469-469: trailing spaces
(trailing-spaces)
[error] 475-475: trailing spaces
(trailing-spaces)
[error] 481-481: trailing spaces
(trailing-spaces)
[error] 559-559: trailing spaces
(trailing-spaces)
[error] 603-603: trailing spaces
(trailing-spaces)
[error] 609-609: trailing spaces
(trailing-spaces)
[error] 615-615: trailing spaces
(trailing-spaces)
[error] 693-693: trailing spaces
(trailing-spaces)
[error] 743-743: trailing spaces
(trailing-spaces)
[error] 803-803: trailing spaces
(trailing-spaces)
[error] 805-805: trailing spaces
(trailing-spaces)
[error] 812-812: trailing spaces
(trailing-spaces)
[error] 856-856: trailing spaces
(trailing-spaces)
[error] 870-870: trailing spaces
(trailing-spaces)
🔇 Additional comments (9)
.github/scripts/sanitize-config.py (3)
10-16: LGTM! Clean transition to regex-based processing.The import change and updated docstring correctly reflect the shift from YAML parsing to regex-based text processing.
17-22: Good approach for plain text processing.Reading the entire file as text and logging the file size provides good debugging information for the regex-based sanitization.
37-42: File writing and debug output look good.The approach to write back the sanitized content and log the final file size provides good traceability for debugging.
.github/workflows/sync-docs-from-node.yml (6)
8-86: Excellent consolidation of version parameters.The changes successfully implement the PR objective of consolidating
source_branchandtaginto a singleversionparameter. The unified API path defaults and proper handling of both dispatch types improve workflow clarity.
100-143: Robust version detection with good error handling.The automatic detection of the latest semantic version tag is well-implemented with proper error handling and comprehensive debugging output. The regex pattern correctly filters semantic versions.
256-376: Excellent debugging enhancement for config sync.The comprehensive debugging output will significantly improve troubleshooting of the config sanitization process. The verification steps ensure the sanitization worked correctly.
470-485: Smart regex matching with PCRE support.The
matches_patternfunction is a well-designed solution that provides PCRE support through perl while maintaining compatibility with systems that only have grep. This addresses the limitations with negative lookahead patterns in the API filtering.
839-839: Good use of --force-with-lease for safer force push.Using
--force-with-leaseinstead of--forceprovides better safety by ensuring the remote branch hasn't been updated by someone else since the last fetch.
853-872: Smart PR creation logic prevents duplicates.The logic to check for existing PRs and only create new ones when necessary is a good improvement. Properly handling both open and closed PR states prevents workflow conflicts.
| # Remove node.admin section | ||
| # This regex matches the admin: line and all indented content that follows | ||
| admin_pattern = r'(\n\s+admin:\s*\n(?:\s+(?:port:\s*\d+|\S.*)\s*\n)*)' | ||
| if re.search(admin_pattern, content): | ||
| content = re.sub(admin_pattern, '\n', content) | ||
| print("Removed node.admin section") | ||
|
|
||
| # Write back to file preserving the structure | ||
| # Remove node.dev section | ||
| # This regex matches the dev: line and all indented content that follows | ||
| dev_pattern = r'(\n\s+dev:\s*\n(?:\s+\S.*\s*\n)*)' | ||
| if re.search(dev_pattern, content): | ||
| content = re.sub(dev_pattern, '\n', content) | ||
| print("Removed node.dev section") | ||
|
|
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.
🛠️ Refactor suggestion
Regex patterns may be unreliable for YAML parsing.
The regex patterns have several potential issues:
- Restrictive admin pattern: The pattern
port:\s*\d+|\S.*is too specific and may miss other admin configuration fields - Missing edge cases: Patterns require leading newlines, potentially missing sections at file start
- YAML structure assumptions: The patterns assume specific indentation which may vary
Consider more robust patterns:
-admin_pattern = r'(\n\s+admin:\s*\n(?:\s+(?:port:\s*\d+|\S.*)\s*\n)*)'
+admin_pattern = r'(\n?\s*admin:\s*\n(?:\s+.*\n)*)'
-dev_pattern = r'(\n\s+dev:\s*\n(?:\s+\S.*\s*\n)*)'
+dev_pattern = r'(\n?\s*dev:\s*\n(?:\s+.*\n)*)'Or consider keeping the YAML parsing approach for reliability, as structured data parsing is inherently more robust than regex for this use case.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Remove node.admin section | |
| # This regex matches the admin: line and all indented content that follows | |
| admin_pattern = r'(\n\s+admin:\s*\n(?:\s+(?:port:\s*\d+|\S.*)\s*\n)*)' | |
| if re.search(admin_pattern, content): | |
| content = re.sub(admin_pattern, '\n', content) | |
| print("Removed node.admin section") | |
| # Write back to file preserving the structure | |
| # Remove node.dev section | |
| # This regex matches the dev: line and all indented content that follows | |
| dev_pattern = r'(\n\s+dev:\s*\n(?:\s+\S.*\s*\n)*)' | |
| if re.search(dev_pattern, content): | |
| content = re.sub(dev_pattern, '\n', content) | |
| print("Removed node.dev section") | |
| # Remove node.admin section | |
| # This regex matches the admin: line and all indented content that follows | |
| admin_pattern = r'(\n?\s*admin:\s*\n(?:\s+.*\n)*)' | |
| if re.search(admin_pattern, content): | |
| content = re.sub(admin_pattern, '\n', content) | |
| print("Removed node.admin section") | |
| # Remove node.dev section | |
| # This regex matches the dev: line and all indented content that follows | |
| dev_pattern = r'(\n?\s*dev:\s*\n(?:\s+.*\n)*)' | |
| if re.search(dev_pattern, content): | |
| content = re.sub(dev_pattern, '\n', content) | |
| print("Removed node.dev section") |
🤖 Prompt for AI Agents
In .github/scripts/sanitize-config.py around lines 23 to 36, the current regex
patterns for removing the node.admin and node.dev sections are too restrictive,
rely on specific indentation and leading newlines, and may miss valid YAML
structures. To fix this, replace the regex-based removal with a YAML parsing
approach: load the content as YAML, remove the 'admin' and 'dev' keys from the
'node' section if present, then dump the YAML back to string. This ensures
reliable and accurate removal regardless of formatting or indentation
variations.
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.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
.github/workflows/sync-docs-from-node.yml (1)
744-755: Arithmetic uses raw outputs that may be empty →bash: syntax error: operand expectedWhen an output is absent the expression
${{ steps.* || 0 }}is replaced by an empty string, not0.
Withset -euo pipefail, the arithmetic expansion aborts.-TOTAL_ADDED=$(( ${{ steps.sync_changelog.outputs.changelog_added || 0 }} + \ - ${{ steps.sync_api_gen.outputs.api_gen_added || 0 }} + \ - ${{ steps.sync_api_debug.outputs.api_debug_added || 0 }} )) +TOTAL_ADDED=$(( ${{ + steps.sync_changelog.outputs.changelog_added }}0 + \ + ${{ steps.sync_api_gen.outputs.api_gen_added }}0 + \ + ${{ steps.sync_api_debug.outputs.api_debug_added }}0 ))Alternatively assign each output to a shell variable with a default (
${var:-0}) before arithmetic.
♻️ Duplicate comments (3)
.github/workflows/sync-docs-from-node.yml (3)
92-93:secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKENis still invalid in Actions expressionsGitHub expressions cannot read an unset secret – the step will fail before your fallback is evaluated.
Provide onlysecrets.NODE_REPO_TOKENhere and set that secret toGITHUB_TOKENat repository level if a dedicated token is not configured.
This was flagged previously but remains unchanged.
147-151: Branch-name sanitisation still too narrowReplacing only
/leaves spaces and other illegal ref characters unhandled (e.g.release candidate/v0.4.0).
Please extend sanitisation to allow[A-Za-z0-9._-]only and collapse invalid runs.
This mirrors prior feedback.
778-785:git addaborts when any listed path is absentThe command still lists fixed directories; if one is missing the step fails.
Usegit add -Aor conditionally add existing directories.
Same issue was pointed out earlier.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(19 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 131-131: trailing spaces
(trailing-spaces)
[error] 151-151: trailing spaces
(trailing-spaces)
[error] 157-157: trailing spaces
(trailing-spaces)
[error] 249-249: trailing spaces
(trailing-spaces)
[error] 255-255: trailing spaces
(trailing-spaces)
[error] 270-270: trailing spaces
(trailing-spaces)
[error] 275-275: trailing spaces
(trailing-spaces)
[error] 281-281: trailing spaces
(trailing-spaces)
[error] 284-284: trailing spaces
(trailing-spaces)
[error] 291-291: trailing spaces
(trailing-spaces)
[error] 296-296: trailing spaces
(trailing-spaces)
[error] 303-303: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 334-334: trailing spaces
(trailing-spaces)
[error] 347-347: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 361-361: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 377-377: trailing spaces
(trailing-spaces)
[error] 389-389: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 419-419: trailing spaces
(trailing-spaces)
[error] 437-437: trailing spaces
(trailing-spaces)
[error] 445-445: trailing spaces
(trailing-spaces)
[error] 448-448: trailing spaces
(trailing-spaces)
[error] 469-469: trailing spaces
(trailing-spaces)
[error] 475-475: trailing spaces
(trailing-spaces)
[error] 481-481: trailing spaces
(trailing-spaces)
[error] 546-546: trailing spaces
(trailing-spaces)
[error] 590-590: trailing spaces
(trailing-spaces)
[error] 596-596: trailing spaces
(trailing-spaces)
[error] 602-602: trailing spaces
(trailing-spaces)
[error] 667-667: trailing spaces
(trailing-spaces)
[error] 717-717: trailing spaces
(trailing-spaces)
[error] 777-777: trailing spaces
(trailing-spaces)
[error] 779-779: trailing spaces
(trailing-spaces)
[error] 786-786: trailing spaces
(trailing-spaces)
[error] 830-830: trailing spaces
(trailing-spaces)
[error] 844-844: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - genlayer-docs
- GitHub Check: Header rules - genlayer-docs
- GitHub Check: Pages changed - genlayer-docs
| # Default to "latest" if version not provided | ||
| VERSION="${{ github.event.client_payload.version }}" | ||
| if [ -z "$VERSION" ]; then | ||
| VERSION="latest" | ||
| fi | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "changelog_path=${{ github.event.client_payload.changelog_path || 'docs/changelog' }}" >> $GITHUB_OUTPUT |
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.
Guard also against the literal "null" returned by missing inputs
${{ github.event.client_payload.version }} expands to the string null when the key is absent.
-z "$VERSION" doesn’t catch that, so an invalid ref (null) may be checked-out, breaking the workflow.
-VERSION="${{ github.event.client_payload.version }}"
-if [ -z "$VERSION" ]; then
- VERSION="latest"
-fi
+raw_version='${{ github.event.client_payload.version }}'
+# Treat empty or "null" as unset
+if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then
+ VERSION="latest"
+else
+ VERSION="$raw_version"
+fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Default to "latest" if version not provided | |
| VERSION="${{ github.event.client_payload.version }}" | |
| if [ -z "$VERSION" ]; then | |
| VERSION="latest" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "changelog_path=${{ github.event.client_payload.changelog_path || 'docs/changelog' }}" >> $GITHUB_OUTPUT | |
| # Default to "latest" if version not provided | |
| raw_version='${{ github.event.client_payload.version }}' | |
| # Treat empty or "null" as unset | |
| if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then | |
| VERSION="latest" | |
| else | |
| VERSION="$raw_version" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "changelog_path=${{ github.event.client_payload.changelog_path || 'docs/changelog' }}" >> $GITHUB_OUTPUT |
🤖 Prompt for AI Agents
In .github/workflows/sync-docs-from-node.yml around lines 68 to 74, the script
sets VERSION from github.event.client_payload.version but does not handle the
case where this expands to the literal string "null". Update the condition to
check if VERSION is empty or equals "null" and in either case set VERSION to
"latest" to prevent using an invalid ref. This ensures the workflow does not
break due to an invalid version value.
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/workflows/sync-docs-from-node.yml (4)
68-74: Guard against literal"null"whenversionis missing
${{ github.event.client_payload.version }}expands to the stringnullwhen the key is absent.
The current check only tests for an empty string, so"null"slips through and becomes an invalid ref.-VERSION="${{ github.event.client_payload.version }}" -if [ -z "$VERSION" ]; then - VERSION="latest" -fi +RAW_VERSION='${{ github.event.client_payload.version }}' +# Treat empty or "null" as unset +if [ -z "$RAW_VERSION" ] || [ "$RAW_VERSION" = "null" ]; then + VERSION="latest" +else + VERSION="$RAW_VERSION" +fi
91-93:||fallback with secrets is still invalid
secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKENis not permitted—referencing an unset secret aborts evaluation before the fallback is considered.
Use a single secret here and setNODE_REPO_TOKENtoGITHUB_TOKENat the repository level if no dedicated token exists.-token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }} +token: ${{ secrets.NODE_REPO_TOKEN }}
160-162: Branch-name sanitisation still too narrowReplacing only
/leaves other illegal characters (spaces, unicode, etc.). Reuse the earlier suggestion to retain[A-Za-z0-9._-]and collapse everything else:-SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') +SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-' '-' | sed 's/^-*//;s/-*$//')
802-803:git addfails when a listed path is absentIf any of
pages/validatorsetc. don’t exist, the command aborts and the workflow hard-fails.
Either usegit add -Aor conditionally add directories.-git add content/validators pages/api-references pages/validators +git add -A # safer: adds only existing paths
🧹 Nitpick comments (1)
.github/workflows/sync-docs-from-node.yml (1)
51-56: Minor: unnecessary PyYAML installThe sanitisation script now uses regex, not YAML parsing;
pyyamlis no longer required.
Dropping the install will save ~10 s of workflow time.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(19 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update configuration examples with new contract addresses in setup-guide.mdx when applicable
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 131-131: trailing spaces
(trailing-spaces)
[error] 157-157: trailing spaces
(trailing-spaces)
[error] 162-162: trailing spaces
(trailing-spaces)
[error] 164-164: trailing spaces
(trailing-spaces)
[error] 167-167: trailing spaces
(trailing-spaces)
[error] 173-173: trailing spaces
(trailing-spaces)
[error] 180-180: trailing spaces
(trailing-spaces)
[error] 182-182: trailing spaces
(trailing-spaces)
[error] 273-273: trailing spaces
(trailing-spaces)
[error] 279-279: trailing spaces
(trailing-spaces)
[error] 294-294: trailing spaces
(trailing-spaces)
[error] 299-299: trailing spaces
(trailing-spaces)
[error] 305-305: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 315-315: trailing spaces
(trailing-spaces)
[error] 320-320: trailing spaces
(trailing-spaces)
[error] 327-327: trailing spaces
(trailing-spaces)
[error] 332-332: trailing spaces
(trailing-spaces)
[error] 342-342: trailing spaces
(trailing-spaces)
[error] 358-358: trailing spaces
(trailing-spaces)
[error] 371-371: trailing spaces
(trailing-spaces)
[error] 379-379: trailing spaces
(trailing-spaces)
[error] 385-385: trailing spaces
(trailing-spaces)
[error] 391-391: trailing spaces
(trailing-spaces)
[error] 401-401: trailing spaces
(trailing-spaces)
[error] 413-413: trailing spaces
(trailing-spaces)
[error] 422-422: trailing spaces
(trailing-spaces)
[error] 443-443: trailing spaces
(trailing-spaces)
[error] 461-461: trailing spaces
(trailing-spaces)
[error] 469-469: trailing spaces
(trailing-spaces)
[error] 472-472: trailing spaces
(trailing-spaces)
[error] 493-493: trailing spaces
(trailing-spaces)
[error] 499-499: trailing spaces
(trailing-spaces)
[error] 505-505: trailing spaces
(trailing-spaces)
[error] 570-570: trailing spaces
(trailing-spaces)
[error] 614-614: trailing spaces
(trailing-spaces)
[error] 620-620: trailing spaces
(trailing-spaces)
[error] 626-626: trailing spaces
(trailing-spaces)
[error] 691-691: trailing spaces
(trailing-spaces)
[error] 741-741: trailing spaces
(trailing-spaces)
[error] 801-801: trailing spaces
(trailing-spaces)
[error] 803-803: trailing spaces
(trailing-spaces)
[error] 810-810: trailing spaces
(trailing-spaces)
[error] 854-854: trailing spaces
(trailing-spaces)
[error] 868-868: trailing spaces
(trailing-spaces)
49bef72 to
493a9db
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (4)
.github/workflows/sync-docs-from-node.yml (4)
148-152: Branch-name sanitisation still too narrowOnly replacing
/leaves other illegal or dangerous characters (spaces, unicode, control chars).
Use a whitelist approach to keep[A-Za-z0-9._-]and collapse any invalid run to-.- SAFE_VERSION=$(echo "$VERSION" | sed 's/\//-/g') + SAFE_VERSION=$(echo "$VERSION" | tr -c 'A-Za-z0-9._-' '-' | sed 's/^-*//;s/-*$//;s/-\{2,\}/-/g')
67-74: Treat the literal string"null"the same as an empty value when defaulting VERSIONThe earlier review already highlighted that
${{ github.event.client_payload.version }}expands to the stringnullwhen the key is missing.
The current guard still only checks for an empty string, so a value ofnullslips through and later becomes an invalid Git ref, breakinggit checkout.- VERSION="${{ github.event.client_payload.version }}" - if [ -z "$VERSION" ]; then - VERSION="latest" - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT + raw_version='${{ github.event.client_payload.version }}' +# Treat empty or "null" as unset + if [ -z "$raw_version" ] || [ "$raw_version" = "null" ]; then + VERSION="latest" + else + VERSION="$raw_version" + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT
92-93:token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }}will hard-fail if the first secret is undefinedGitHub Actions refuses to reference an unset secret – the entire job errors out before runtime evaluation.
Remove the inline fallback and instead guarantee thatNODE_REPO_TOKENis always populated (e.g. set it to the value ofGITHUB_TOKENat repo level) or fall back at runtime inside the script.- token: ${{ secrets.NODE_REPO_TOKEN || secrets.GITHUB_TOKEN }} + token: ${{ secrets.NODE_REPO_TOKEN }}
778-785:git addaborts when any listed path is missingIf, for example,
pages/validatorsdoes not exist in this run, the whole job fails.
Either add paths conditionally or simply stage all modifications.- git add content/validators pages/api-references pages/validators + git add -A
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/sync-docs-from-node.yml(19 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Use consistent format for changelog entries in changelog.mdx
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update configuration examples with new contract addresses in setup-guide.mdx when applicable
.github/workflows/sync-docs-from-node.yml (7)
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable and will result in an empty string. To capture workflow run timestamps, use a shell command like date -u +"%Y-%m-%dT%H:%M:%SZ" in a step and reference it via step outputs.
Learnt from: dohernandez
PR: #245
File: .github/workflows/sync-docs-from-node.yml:451-462
Timestamp: 2025-07-14T09:41:24.667Z
Learning: In GitHub Actions workflows, github.run_started_at is not a valid context variable. The only timestamp available is github.event.workflow_run.run_started_at, which is only available for workflows triggered by workflow_run events. For other event types like repository_dispatch and workflow_dispatch, use shell commands like date -u to capture timestamps.
Learnt from: CR
PR: genlayerlabs/genlayer-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)
🪛 YAMLlint (1.37.1)
.github/workflows/sync-docs-from-node.yml
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 131-131: trailing spaces
(trailing-spaces)
[error] 151-151: trailing spaces
(trailing-spaces)
[error] 157-157: trailing spaces
(trailing-spaces)
[error] 249-249: trailing spaces
(trailing-spaces)
[error] 255-255: trailing spaces
(trailing-spaces)
[error] 270-270: trailing spaces
(trailing-spaces)
[error] 275-275: trailing spaces
(trailing-spaces)
[error] 281-281: trailing spaces
(trailing-spaces)
[error] 284-284: trailing spaces
(trailing-spaces)
[error] 291-291: trailing spaces
(trailing-spaces)
[error] 296-296: trailing spaces
(trailing-spaces)
[error] 303-303: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 334-334: trailing spaces
(trailing-spaces)
[error] 347-347: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 361-361: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 377-377: trailing spaces
(trailing-spaces)
[error] 389-389: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 419-419: trailing spaces
(trailing-spaces)
[error] 437-437: trailing spaces
(trailing-spaces)
[error] 445-445: trailing spaces
(trailing-spaces)
[error] 448-448: trailing spaces
(trailing-spaces)
[error] 469-469: trailing spaces
(trailing-spaces)
[error] 475-475: trailing spaces
(trailing-spaces)
[error] 481-481: trailing spaces
(trailing-spaces)
[error] 546-546: trailing spaces
(trailing-spaces)
[error] 590-590: trailing spaces
(trailing-spaces)
[error] 596-596: trailing spaces
(trailing-spaces)
[error] 602-602: trailing spaces
(trailing-spaces)
[error] 667-667: trailing spaces
(trailing-spaces)
[error] 717-717: trailing spaces
(trailing-spaces)
[error] 777-777: trailing spaces
(trailing-spaces)
[error] 779-779: trailing spaces
(trailing-spaces)
[error] 786-786: trailing spaces
(trailing-spaces)
[error] 830-830: trailing spaces
(trailing-spaces)
[error] 844-844: trailing spaces
(trailing-spaces)
| # Function to check if filename matches the regex pattern | ||
| # Uses perl if available for PCRE support, otherwise falls back to grep -E | ||
| matches_pattern() { | ||
| local filename="$1" | ||
| local pattern="$2" | ||
|
|
||
| # Try perl first (supports PCRE including negative lookahead) | ||
| if command -v perl >/dev/null 2>&1; then | ||
| echo "$filename" | perl -ne "exit 0 if /^($pattern)\$/; exit 1" | ||
| return $? | ||
| fi | ||
|
|
||
| # Fallback to grep -E (doesn't support negative lookahead) | ||
| echo "$filename" | grep -E "^($pattern)$" >/dev/null 2>&1 | ||
| return $? | ||
| } |
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.
🛠️ Refactor suggestion
matches_pattern is vulnerable to regex & quote injection
$pattern is expanded inside a double-quoted Perl one-liner without any escaping.
A crafted pattern containing / or " will break the command and could even execute unintended code inside the shell.
Minimal safe fix:
- echo "$filename" | perl -ne "exit 0 if /^($pattern)\$/; exit 1"
+ perl -e '
+ my ($file, $re) = @ARGV;
+ exit(($file =~ /^${re}$/) ? 0 : 1);
+ ' -- "$filename" "$pattern"Or escape the pattern before embedding.
[security]
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Function to check if filename matches the regex pattern | |
| # Uses perl if available for PCRE support, otherwise falls back to grep -E | |
| matches_pattern() { | |
| local filename="$1" | |
| local pattern="$2" | |
| # Try perl first (supports PCRE including negative lookahead) | |
| if command -v perl >/dev/null 2>&1; then | |
| echo "$filename" | perl -ne "exit 0 if /^($pattern)\$/; exit 1" | |
| return $? | |
| fi | |
| # Fallback to grep -E (doesn't support negative lookahead) | |
| echo "$filename" | grep -E "^($pattern)$" >/dev/null 2>&1 | |
| return $? | |
| } | |
| # Function to check if filename matches the regex pattern | |
| # Uses perl if available for PCRE support, otherwise falls back to grep -E | |
| matches_pattern() { | |
| local filename="$1" | |
| local pattern="$2" | |
| # Try perl first (supports PCRE including negative lookahead) | |
| if command -v perl >/dev/null 2>&1; then | |
| perl -e ' | |
| my ($file, $re) = @ARGV; | |
| exit(($file =~ /^${re}$/) ? 0 : 1); | |
| ' -- "$filename" "$pattern" | |
| return $? | |
| fi | |
| # Fallback to grep -E (doesn't support negative lookahead) | |
| echo "$filename" | grep -E "^($pattern)$" >/dev/null 2>&1 | |
| return $? | |
| } |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 475-475: trailing spaces
(trailing-spaces)
[error] 481-481: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents
In .github/workflows/sync-docs-from-node.yml around lines 470 to 485, the
matches_pattern function embeds the $pattern variable directly inside a
double-quoted Perl one-liner, which risks regex and quote injection if $pattern
contains special characters like / or ". To fix this, escape all special
characters in $pattern before embedding it in the Perl command, or alternatively
use a safer method to pass the pattern to Perl without direct interpolation,
ensuring the shell command cannot be broken or exploited.
chore(workflows): Simplify sync-docs-from-node workflow
Description
This PR simplifies the sync-docs-from-node workflow by consolidating the
source_branchandtagparameters into a singleversionparameter. The workflow now uses the version/tag directly to checkout the correct release from the genlayer-node repository, eliminating confusion and ensuring documentation always matches the exact version being documented.Summary by CodeRabbit