feat: onboarding dust-github-action#1
Conversation
| const { core } = config; | ||
|
|
||
| const zip = new AdmZip(); | ||
| addDirectoryToZip(zip, ".", "."); |
There was a problem hiding this comment.
Security: Entire workspace sent to external API
addDirectoryToZip(zip, ".", ".") packages the entire repository (only skipping .git and node_modules) and sends it to Dust's API. Any secrets files present in the repo (.env, private keys, config files with credentials) would be included in the upload.
Consider adding an explicit allowlist (only include directories with SKILL.md) or at minimum a denylist that also skips common sensitive file patterns:
| addDirectoryToZip(zip, ".", "."); | |
| addDirectoryToZip(zip, ".", ".", [".env", "*.pem", "*.key", "*.p12", "*.pfx"]); |
Or, better, only zip directories that contain a SKILL.md file rather than the entire workspace.
| } | ||
|
|
||
| const files = patterns.flatMap((pattern) => { | ||
| const matches = fs.globSync(pattern); |
There was a problem hiding this comment.
Security: Path traversal risk via user-supplied glob patterns
fs.globSync(pattern) executes directly with patterns sourced from the agent-configs workflow input. A pattern such as ../../secrets or /etc/passwd could resolve files outside the workspace directory. The matched files are then parsed as YAML and their full content is sent (via PATCH/POST) to the Dust API — making this a potential exfiltration vector.
Add a guard to reject patterns that resolve outside the workspace:
const resolved = path.resolve(f);
const cwd = process.cwd();
if (!resolved.startsWith(cwd + path.sep) && resolved !== cwd) {
throw new Error(`Pattern "${pattern}" matched file outside workspace: ${f}`);
}| core.error( | ||
| `\u001b[31mLearn how to enable a subscription: ${docsUrl}\u001b[0m` | ||
| ); | ||
| process.exit(1); |
There was a problem hiding this comment.
Non-idiomatic failure pattern — use core.setFailed()
process.exit(1) bypasses any cleanup handlers registered in the Node.js process and suppresses the standard GitHub Actions error message formatting. Prefer the idiomatic approach:
| process.exit(1); | |
| core.setFailed( | |
| `This action requires a StepSecurity subscription for private repositories. Learn how to enable a subscription: ${docsUrl}` | |
| ); | |
| return; |
| test-upsert-skills: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 |
There was a problem hiding this comment.
Suspicious action versions — checkout@v7 and setup-node@v7
Both actions/checkout and actions/setup-node were at v4 as of the most recent stable releases. @v7 does not exist and will cause this workflow to fail at runtime. Please pin to known stable versions:
| - uses: actions/checkout@v7 | |
| - uses: actions/checkout@v4 |
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - uses: actions/setup-node@v7 |
There was a problem hiding this comment.
Same issue — actions/setup-node@v7 does not exist:
| - uses: actions/setup-node@v7 | |
| - uses: actions/setup-node@v4 |
PR ReviewAction TypeNode-based action — uses ✅ Passed Checks
❌ Failed Checks
|
No description provided.