Skip to content

fix(api-docs/cpp): silence actionlint SC2016 on find globs#72

Merged
WomB0ComB0 merged 1 commit intomainfrom
fix/cpp-template-actionlint-SC2016
May 10, 2026
Merged

fix(api-docs/cpp): silence actionlint SC2016 on find globs#72
WomB0ComB0 merged 1 commit intomainfrom
fix/cpp-template-actionlint-SC2016

Conversation

@WomB0ComB0
Copy link
Copy Markdown
Member

Surfaced during the cpp sync (resq-software/vcpkg#11). vcpkgs gates / 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

  • Visual diff: 5 lines changed, single → double quotes around the literal *.md and *.#ctor.md glob args.
  • After merge + sync to vcpkg, the gates / Security / actionlint check should pass.

Related

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Warning

Rate limit exceeded

@WomB0ComB0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 43 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

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

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 422e5a37-3e55-4e7c-a3fa-38a7ec318064

📥 Commits

Reviewing files that changed from the base of the PR and between 048379a and 8923386.

📒 Files selected for processing (1)
  • automation/source-repo-templates/api-docs.cpp.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cpp-template-actionlint-SC2016

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

❤️ Share

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

@github-actions github-actions Bot added the area:content MDX/MD documentation content label May 10, 2026
@WomB0ComB0 WomB0ComB0 merged commit 05abdaa into main May 10, 2026
13 checks passed
@WomB0ComB0 WomB0ComB0 deleted the fix/cpp-template-actionlint-SC2016 branch May 10, 2026 13:52
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Code Review

This pull request 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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
  1. For documentation synchronization workflows that force-push to the same branch, set cancel-in-progress: true to prevent race conditions from concurrent runs.
  2. 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 \
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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
  1. 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.
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:content MDX/MD documentation content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant