Fix use of safe.directory inside containers

Inside a container the actual workspace path is a mount point and not the same as outside the container.
E.g.:
- `${{github.workspace}} == /home/runner/work/locale/locale`
- `$GITHUB_WORKSPACE == /__w/locale/locale`

So it seems `/home/runner/work` is mounted at `/__w` and this is reflected by the environment variable but not the context.   
So use that variable instead.
This commit is contained in:
Alexander Grund 2025-02-15 19:13:51 +01:00 committed by GitHub
parent 4898080f15
commit 19ac6f1f20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,7 +181,7 @@ runs:
if: ${{ inputs.disable_safe_directory != 'true' }}
shell: bash
run: |
git config --global --add safe.directory ${{ github.workspace }}
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set fork
shell: bash