-
Notifications
You must be signed in to change notification settings - Fork 33
Stop the nightly translation re-translating everything, most days #685
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
base: main
Are you sure you want to change the base?
Changes from all commits
a05bab4
dcfa1c5
b20ebad
d960a1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { readFileSync, writeFileSync, mkdirSync } from "node:fs"; | ||
| import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
| import { LANGUAGES, getLanguageByCode } from "./config"; | ||
|
|
@@ -220,7 +220,9 @@ export async function translateReadme( | |
| // Check cache — use provided cache object or read from disk | ||
| if (!options.force && !options.dryRun) { | ||
| const cache = options.cache ?? readCache(); | ||
| if (isCached(cache, "README.md", lang, sourceContent)) { | ||
| // `&& existsSync(outputPath)` — see the MDX path. Cached records that a | ||
| // translation was produced, not that the file is there now. | ||
| if (isCached(cache, "README.md", lang, sourceContent) && existsSync(outputPath)) { | ||
|
Comment on lines
+223
to
+225
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Add direct tests for the README cache condition. The supplied tests invoke Add tests in 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| return { | ||
| lang, | ||
| sourcePath: README_PATH, | ||
|
|
||
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: FailproofAI/failproofai
Length of output: 9116
🏁 Script executed:
Repository: FailproofAI/failproofai
Length of output: 50379
🏁 Script executed:
Repository: FailproofAI/failproofai
Length of output: 1652
Validate and quote
inputs.languagesbefore shell useA
workflow_dispatchuser can setinputs.languages. The value reachesprepareshell source and the unquoted translation command. For example,en;idrunsidas a separate command whileANTHROPIC_API_KEYis set. Validate each language against the supported allowlist inprepare, then pass the validated value through a quoted environment variable.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 108-108: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
🤖 Prompt for AI Agents
Source: Linters/SAST tools