Git Ссылка на ошибку при запуске сборки в конвейере CI / CD (AWS CodeBuild) - PullRequest
0 голосов
/ 13 июля 2020

Я настроил конвейер CI / CD в AWS CodeBuild с монорепозиторием GitHub в качестве источника. Когда я объединяю ветку в master, она запускает сборку.

Сборка, настроенная в файле yaml, имеет следующие git команды, и когда я пытаюсь запустить git fetch, я получаю ошибки ref head:

[Container] 2020/07/13 12:43:06 Running command git init
Reinitialized existing Git repository in /codebuild/output/id/src/github.com/***/repo/.git/

[Container] 2020/07/13 12:43:06 Running command git config user.email "user_email"

[Container] 2020/07/13 12:43:06 Running command git config user.name "***"

[Container] 2020/07/13 12:43:06 Running command git remote -v
origin  https://github.com/***/repo.git (fetch)
origin  https://github.com/***/repo.git (push)

[Container] 2020/07/13 12:43:06 Running command git remote set-url origin https://***:pwd@github.com/***/repo.git

[Container] 2020/07/13 12:43:06 Running command git fetch origin
error: refs/pull/1/head does not point to a valid object!
...
error: refs/pull/9/head does not point to a valid object!

[Container] 2020/07/13 12:43:07 Running command git checkout -f $GIT_BRANCH
error: refs/pull/1/head does not point to a valid object!
...
error: refs/pull/9/head does not point to a valid object!
Previous HEAD position was 46369d0 Update buildspec.yaml
Switched to branch 'master'

[Container] 2020/07/13 12:43:07 Running command git status
On branch master
nothing to commit, working tree clean

Я пробовал git reset и git rm -r --cached, но могу решить эту проблему.

Когда я запускал сборку после pu sh в главную ветку, сборка завершилась успешно . После обновления репозитория в контейнере я запустил lerna publish, чтобы обновить версии пакетов и развернуть все ресурсы с помощью Terraform.

...