From 19ac6f1f20b137045b74388fb6b332f4755c6709 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 15 Feb 2025 19:13:51 +0100 Subject: [PATCH] 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. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5333ef6..73c7e84 100644 --- a/action.yml +++ b/action.yml @@ -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