Skip to content

Commit

Permalink
Fix use of safe.directory inside containers (#1768)
Browse files Browse the repository at this point in the history
* 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 <88201630+thomasrockhu-codecov@users.noreply.github.com>
  • Loading branch information
Flamefire and thomasrockhu-codecov authored Feb 18, 2025
1 parent a5dc5a5 commit 2e6e9c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ 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 }}"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set fork
shell: bash
Expand Down

0 comments on commit 2e6e9c5

Please sign in to comment.