File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ git submodule update --init ${SUBMODULE_PATH}")
6363
6464 # Clone the submodule if not done already
6565 if (NOT SUBMODULE_CLONED)
66+
67+ # Github Actions has an issue where the clone of the repo is done as a different user
68+ # https://github.com/actions/checkout/issues/47
69+ # This causes an error like 'fatal: unsafe repository ('/__w/mbed-os/mbed-os' is owned by someone else)'
70+ # Other than chown-ing the source directory after the checkout step, it seems like the only fix
71+ # is to run the following command if we detect Github Actions
72+ if (NOT "$ENV{GITHUB_RUN_ID} " STREQUAL "" )
73+ execute_process (
74+ COMMAND ${GIT_EXECUTABLE} config --global --add safe.directory ${CMAKE_SOURCE_DIR}
75+ COMMAND_ERROR_IS_FATAL ANY
76+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
77+ )
78+ endif ()
79+
80+
6681 if (MBED_USE_SHALLOW_SUBMODULES)
6782 set (SHALLOW_ARGS --depth 1)
6883 else ()
You can’t perform that action at this time.
0 commit comments