A container job fails on any Git command with `fatal: detected dubious ownership in repository at '/__w/app/app'`.
IntermediateTroubleshootingGitHub, Actions and Pull Request Issues
Answer
Likely causes → Since Git 2.35.2 (CVE-2022-24765), Git refuses to work in a repo owned by a different user. The workspace was checked out by the runner user, but the container runs as root (or vice versa). Same issue on shared servers and Docker volume mounts.
Diagnose →
id -u; stat -c '%u %n' /__w/app/app
git --version
Fix → Mark that path as safe, inside the same user context that runs Git:
git config --global --add safe.directory /__w/app/app
# or, in a throwaway container only:
git config --global --add safe.directory '*'
Recent actions/checkout sets this for you; the problem appears when later steps run as another user or in another container.
Prevent → Run containers with the same UID as the workspace owner, and avoid the '*' wildcard on shared hosts.
More on GitHub, Actions and Pull Request Issues
A workflow step that pushes a version bump fails with `remote: Permission to org/repo.git denied to github-actions[bot].` and `The requested URL returned error: 403`.IntermediateA workflow pushes a commit or tag, but the workflow that should run on that push or tag never starts.IntermediateYour PR suddenly shows 340 changed files and dozens of commits you did not write.IntermediateThe PR is stuck on `Expected — Waiting for status to be reported` for a required check called `build`.IntermediateThe PR was approved, but merging shows "Review required" again after you pushed a small fix.BeginnerCODEOWNERS is committed, but GitHub does not request reviews from the listed team.Intermediate