You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When running megalinter docker in a tekton pipeline, one can stumble upon the quite recent git safe.directory problem so one has to add "git config --global --add safe.directory PATH". I see like you already added patch specifically for github_workspaces default path in entrypoint.sh. Note: An convention (many tekton examples shows this, so I guess other people than us will also use this path) is to use /workspace/source path, even if one does not have to of course.
Describe the solution you'd like
Either just add an extra setting also for TEKTON_WORKSPACE, in the entrypoint.sh, and set /workspace/source/ (fastest fix) or maybe even generalize it to handle all future cases including github, with something like
if [[ -d "${DEFAULT_WORKSPACE}" ]] ; then git config --global --add safe.directory "${DEFAULT_WORKSPACE}"; echo "Setting git safe dir ${DEFAULT_WORKSPACE}" ;~ | else echo 'no dir' ; fi
Further, if generic maybe make the setting configurable - Maybe an env to "SET_GIT_WORKSPACE_AS_GIT_SAFE_DIR" , or something like that.
Describe alternatives you've considered
We create our own image , so we can add this on our own, but,, if we have the problem, other surely has too. Would be nice to have "out of the box" and spare the enduser some possible error hunt.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When running megalinter docker in a tekton pipeline, one can stumble upon the quite recent git safe.directory problem so one has to add "git config --global --add safe.directory PATH". I see like you already added patch specifically for github_workspaces default path in entrypoint.sh. Note: An convention (many tekton examples shows this, so I guess other people than us will also use this path) is to use /workspace/source path, even if one does not have to of course.
Describe the solution you'd like
Either just add an extra setting also for TEKTON_WORKSPACE, in the entrypoint.sh, and set /workspace/source/ (fastest fix) or maybe even generalize it to handle all future cases including github, with something like
if [[ -d "${DEFAULT_WORKSPACE}" ]] ; then git config --global --add safe.directory "${DEFAULT_WORKSPACE}"; echo "Setting git safe dir ${DEFAULT_WORKSPACE}" ;~ | else echo 'no dir' ; fi
Further, if generic maybe make the setting configurable - Maybe an env to "SET_GIT_WORKSPACE_AS_GIT_SAFE_DIR" , or something like that.
Describe alternatives you've considered
We create our own image , so we can add this on our own, but,, if we have the problem, other surely has too. Would be nice to have "out of the box" and spare the enduser some possible error hunt.
The text was updated successfully, but these errors were encountered: