git 在 Kubernetes pod 中使用 GitHub 签出操作时,大型存储库中的推送失败并出现内存错误

git push fails with a memory error in a large repo when using GitHub checkout actions in a Kubernetes pod

我们有一个Public API that includes a nightly metadata updater run via Cron in a pod deployed with Github Actions and Kubernetes。一夜之间,更新程序从我们的私有 API 中提取新的元数据,然后提交这些更改并将它们推送给自己以刷新 Github 存储库并触发 lint/test/build/deployment.

我们正在使用 actions/checkout 默认情况下获取单个提交。

在更新我们的 ~43,000 条记录 ~700mb 存储库几周后,我们开始在 git push 步骤看到失败:error: pack-objects died of signal 9

Enumerating objects: 11754, done.
Counting objects: 100% (10881/10881), done.
error: pack-objects died of signal 9
error: pack-objects died of signal 9
error: remote unpack failed: eof before pack header was fully read

Increasing pod resources 没有帮助。

使用 git fetch --unshallow 后,pod 能够 complete 一个 git commitgit push 到 re-deploy 本身。