首页 > 其他分享 >.gitlab-ci.yml 语法错误导致 runner 报错“expected shallow list”

.gitlab-ci.yml 语法错误导致 runner 报错“expected shallow list”

时间:2023-05-18 10:37:45浏览次数:45  
标签:ci xxx 语法错误 runner gitlab 00 报错

报错信息:

Running with gitlab-runner 15.11.0 (xxx)
  on gitrunnr xxx, system ID: s_xxx
Preparing the "shell" executor 00:00
Preparing environment 00:00
Getting source from Git repository 00:01
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/xxx/0/xxx/test/.git/
fatal: git fetch-pack: expected shallow list
fatal: The remote end hung up unexpectedly
ERROR: Job failed: exit status 1

错误的 .gitlab-ci.yml 示例:

test-this-proj:
  stage: test
  script:
    - echo "${HOSTNAME} Running tests..."
# 此处如果有空行 或者 “#注释”,可绕过gitlab的yaml语法检查,导致runner报错
  tags:
  - shell #缩进错误
  when: always

标签:ci,xxx,语法错误,runner,gitlab,00,报错
From: https://www.cnblogs.com/max27149/p/17411134.html

相关文章