fix(api-docs/cpp): silence actionlint SC2016 on find globs#72
fix(api-docs/cpp): silence actionlint SC2016 on find globs#72WomB0ComB0 merged 1 commit intomainfrom
Conversation
Switch five find calls from single-quoted to double-quoted glob args. shellcheck heuristically flags single-quoted args containing asterisk; double quotes pass the same literal to find, which still handles glob matching.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request modifies the api-docs.cpp.yml workflow template to use double quotes for file patterns in find commands. Feedback suggests applying this change consistently across other templates and adding cancel-in-progress: true to prevent race conditions in synchronization workflows. There is also a recommendation to enhance the find command at line 337 by incorporating -print0, -maxdepth 2, and reordering flags for consistency.
| working-directory: ${{ env.OUTPUT_DIR }} | ||
| run: | | ||
| find . -type f -name '*.md' -print0 | while IFS= read -r -d '' f; do | ||
| find . -type f -name "*.md" -print0 | while IFS= read -r -d '' f; do |
There was a problem hiding this comment.
This change correctly silences the linter warning. Since these files serve as source-of-truth templates, consider applying this same quote-style change to the other templates in this directory (e.g., api-docs.python.yml, api-docs.typescript.yml) to ensure consistency. Additionally, ensure these templates configure cancel-in-progress: true for synchronization workflows and include the relative package path in source code links to ensure correct 'View source' resolution in monorepos.
References
- For documentation synchronization workflows that force-push to the same branch, set cancel-in-progress: true to prevent race conditions from concurrent runs.
- When configuring source code links in documentation generators for monorepos, the base URL must include the relative path to the package directory to ensure 'View source' links resolve correctly.
| working-directory: ${{ env.OUTPUT_DIR }} | ||
| run: | | ||
| find . -name '*.md' -type f \ | ||
| find . -name "*.md" -type f \ |
There was a problem hiding this comment.
For consistency with the other find calls in this file, consider placing the -type f filter before the -name glob. Additionally, use -print0 for safer filename handling (ensuring any downstream commands also use -0). Use -maxdepth 2 to ensure the discovery is bounded to the expected directory levels. If these files are being processed for JSX compatibility, ensure the logic ignores curly braces within inline code spans to prevent breaking snippets.
find . -maxdepth 2 -type f -name "*.md" -print0 \References
- In CI workflows, dynamically discover artifacts (e.g., using 'find' with '-maxdepth 2') instead of hardcoding paths to ensure consistency and prevent failures during upgrades.
- When processing Markdown/MDX files to escape curly braces for JSX compatibility, ensure the logic ignores content within inline code spans (backticks) to prevent breaking code snippets.
Surfaced during the cpp sync (resq-software/vcpkg#11). vcpkg
sgates / Security / actionlintcheck treats shellcheck SC2016 as a hard failure and flagged fivefind . -name '.md'calls in this template. The single-quoted glob is intentional — single OR double quotes both pass the literal.md` to find (no shell-expansion metacharacters either way), and find handles the glob match itself. Switching to double quotes silences SC2016 with no behavior change.The same pattern exists in the other 4 templates but they pass actionlint on their respective target repos (npm, pypi, dotnet-sdk, crates), so this PR is scoped to cpp only.
Test plan
*.mdand*.#ctor.mdglob args.gates / Security / actionlintcheck should pass.Related