fix(ci): reject unsafe generated file additions - #6445
Conversation
✅MegaLinter analysis: Success✅ Linters with no issuesactionlint, bash-exec, git_diff, hadolint, jscpd, jsonlint, lychee, markdown-table-formatter, markdownlint, prettier, prettier, shellcheck, shfmt, stylelint, syft, trivy-sbom, trufflehog, v8r, v8r, yamllint Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts
|
@coderabbitai review |
|
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThe auto-commit workflow now disables persisted checkout credentials. It documents that generated files must be regular 0644 files. It rejects symlinks, non-regular files, and executable files before submitting generated files through the GitHub API. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
@coderabbitai review |
|
✅ Action performedReview finished.
|
@coderabbitai full review |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 20 minutes. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

Motivation
FileAdditionpayload only contains regular non-executable files that the API can faithfully represent instead of silently losing mode info or dereferencing symlinks.Description
persist-credentials: falsefor the job checkout step so the App token is not written into local git config.Testing
persist-credentials: falseis present for the checkout step and that the file-type guard appears before thebase64 -w0content read; assertion succeeded.base64read; the symlink was rejected as expected.git diff --checkandgit diff --cached --checkto validate the change and ensure no accidental whitespace/check failures; both checks passed in this environment.mega-linter-runner -f goandactionlintcould not be run because those executables are not available in the current environment (not run).Codex Task