add git safe directory in action #23
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have had a strange issue appear when using this action in my repo. The formatter runs successfully, but git complains that it is not in a repo when checking if files have changed. The error occurs on line 132 of
format.jl
.Here is an example run that didn't work: https://github.com/musoke/UltraDark.jl/actions/runs/4238135156/jobs/7364871794
And the corresponding configuration:
and the error (snipped a lot of output):
This seems to be because of how directories are nested in the docker environment. See for example actions/checkout#363 (comment)
I changed
entrypoint.sh
to explicitly mark the directory as safe so git agrees to run. This fixed my CI: https://github.com/musoke/UltraDark.jl/actions/runs/4238608466I also added a check that
git diff --name-only
has empty output before the formatter is run.It could well be that I have done something silly.