Skip to content

Commit 2e6e9c5

Browse files
Fix use of safe.directory inside containers (#1768)
* 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. * Update action.yml * Update action.yml * Update action.yml --------- Co-authored-by: Tom Hu <[email protected]>
1 parent a5dc5a5 commit 2e6e9c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ runs:
181181
if: ${{ inputs.disable_safe_directory != 'true' }}
182182
shell: bash
183183
run: |
184-
git config --global --add safe.directory ${{ github.workspace }}
184+
git config --global --add safe.directory "${{ github.workspace }}"
185+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
185186
186187
- name: Set fork
187188
shell: bash

0 commit comments

Comments
 (0)