Skip to content

Mark /app as safe directory for Git #824

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

danut007ro
Copy link

In my github actions I got error

The repository at "/app" does not have the correct ownership and git refuses to use it:

fatal: detected dubious ownership in repository at '/app'
To add an exception for this directory, call:

	git config --global --add safe.directory /app

This PR fixes the issue by adding an actions to mark /app directory as safe for git.

In my github actions I got error

```
The repository at "/app" does not have the correct ownership and git refuses to use it:

fatal: detected dubious ownership in repository at '/app'
To add an exception for this directory, call:

	git config --global --add safe.directory /app
```

This PR fixes the issue by adding an actions to mark /app directory as safe for git.
@7-zete-7
Copy link
Contributor

Hi @danut007ro!

I would suggest adding this command to the Dockerfile for the frankenphp_dev target. WDYT?

@danut007ro
Copy link
Author

Sure @7-zete-7 , have a look now. Thanks

@maxhelias
Copy link
Collaborator

Hum... I don’t think we should add this.
Git isn’t meant to be used inside the container, and this just bypasses the “dubious ownership” warning instead of addressing a real need.
It also adds an unnecessary global config inside the image.

@danut007ro
Copy link
Author

Closing, as I am unable to reproduce on a new project. Will reopen if needed. Thank you.

@danut007ro danut007ro closed this Aug 14, 2025
@danut007ro
Copy link
Author

danut007ro commented Aug 14, 2025

Managed to reproduce on a new clean project. Here's the PR on that new project https://github.com/danut007ro/symfony-docker-test/pull/1/files with result https://github.com/danut007ro/symfony-docker-test/actions/runs/16966099280/job/48090334555?pr=1

As you can see, the warning occurs when running composer audit command. Maybe there is another way to fix it?

Screenshot 2025-08-14 at 16 15 26

@danut007ro danut007ro reopened this Aug 14, 2025
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.

3 participants