Skip to content
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

fix: allow absolute paths to Dangerfile #1475

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/runner/runners/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export const runDangerfileEnvironment = async (
d("Started parsing Dangerfile: ", filename)
let optionalExport
if (filename.endsWith(".mts")) {
const tmpFileName = path.join(process.cwd(), `._dangerfile.mjs`)
const tmpFileName = path.resolve(process.cwd(), `._dangerfile.mjs`)
fs.writeFileSync(tmpFileName, compiled)
// tried but data urls have trouble with imports and I don't know how to fix
// optionalExport = (await import(`data:text/javascript;base64,${btoa(compiled)}`));
optionalExport = await import(tmpFileName)
} else if (filename.endsWith(".mjs")) {
optionalExport = await import(path.join(process.cwd(), filename))
optionalExport = await import(path.resolve(process.cwd(), filename))
} else {
optionalExport = _require(compiled, filename, {})
}
Expand Down