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

Conversation

buffcode
Copy link
Contributor

@buffcode buffcode commented Feb 4, 2025

Problem

We are using Danger within a Docker-container in our CI pipeline. As most of our pipelines use a central Danger configuration as well as standardized CI pipelines, Danger is not required to be setup in every single repository, but fully baked into our container.

The Dangerfile is placed alongside the required dependencies in a different path (/app) than the actual project (/workdir).

When running DangerJS with --dangerfile /app/dangerfile.mjs the path is joined with path.cwd(), resulting in an invalid path like /workdir/app/dangerfile.mjs.

Solution

Switching to path.resolve instead of path.join resolves (pun intended) this, without impacting other use cases.

@orta
Copy link
Member

orta commented Feb 5, 2025

Cool, this makes sense to me

@orta orta merged commit b07053c into danger:main Feb 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants