首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复yaml错误:此处不允许块映射值

如何修复yaml错误:此处不允许块映射值
EN

Stack Overflow用户
提问于 2021-09-07 22:49:12
回答 1查看 38关注 0票数 1

我复制了信号量的GoReleaser的config并将其保存为.semaphore/semaphore.yml,但是当我在信号量上运行它时,我可以看到:

代码语言:javascript
复制
Unprocessable YAML file.
Error: {{:throw, {:yamerl_exception, [{:yamerl_parsing_error, :error, 'Block mapping value not allowed here', 30, 20, :block_mapping_value_not_allowed, :undefined, []}]}}, "# .semaphore/semaphore.yml.\nversion: v1.0\nname: Build\nagent:\n machine:\n type: e1-standard-2\n os_image: ubuntu1804\n\nblocks:\n - name: \"Test\"\n task:\n prologue:\n commands:\n # set go version\n - sem-version go 1.11\n - \"export GOPATH=~/go\"\n - \"export PATH=/home/semaphore/go/bin:$PATH\"\n - checkout\n\n jobs:\n - name: \"Lint\"\n commands:\n - go get ./...\n - go test ./...\n\n# On Semaphore 2.0 deployment and delivery is managed with promotions,\n# which may be automatic or manual and optionally depend on conditions.\npromotions:\n - name: Release\n pipeline_file: goreleaser.yml\n auto_promote_on:\n - result: passed\n branch:\n - \"^refs/tags/v*\"\n"}

我怎么才能修复它?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-09 10:15:16

在最后这部分中:

代码语言:javascript
复制
promotions:
    - name: Release
       pipeline_file: goreleaser.yml
       auto_promote_on:
         - result: passed
           branch:
             - "^refs/tags/v*"

pipeline_fileauto_promote_on的缩进是错误的-两者都需要与name处于同一级别。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69095246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档