File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121 - name : Initialize opencode submodule
2222 run : |
23+ # .gitmodules tracks opencode with an SSH URL. Actions runners
24+ # typically lack SSH deploy keys, so force GitHub remotes to HTTPS.
25+ git config --global --add url."https://github.com/".insteadOf git@github.com:
26+ git config --global --add url."https://github.com/".insteadOf ssh://git@github.com/
2327 git submodule sync --recursive
24- git -c url."https://github.com/".insteadOf=git@github.com: submodule update --init --recursive packages/opencode
28+ git submodule update --init --recursive packages/opencode
2529 git submodule status --recursive
2630
2731 - name : Configure Git
Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ if [[ -f "${gitmodules}" ]]; then
3232 fi
3333fi
3434
35- git -C " ${submodule_dir} " fetch --prune origin " ${submodule_branch} "
35+ # In GitHub Actions, submodule URLs may be SSH-style from .gitmodules
36+ # (git@github.com:...), but runners usually do not have an SSH key.
37+ # Rewrite those URLs to HTTPS for this fetch so CI can read the repo.
38+ git \
39+ -C " ${submodule_dir} " \
40+ -c url." https://github.com/" .insteadOf=git@github.com: \
41+ -c url." https://github.com/" .insteadOf=ssh://git@github.com/ \
42+ fetch --prune origin " ${submodule_branch} "
3643latest_commit=" $( git -C " ${submodule_dir} " rev-parse FETCH_HEAD) "
3744if [[ -z " ${latest_commit} " ]]; then
3845 echo " Failed to resolve latest commit for branch ${submodule_branch} ." >&2
You can’t perform that action at this time.
0 commit comments