我把这个步骤添加到CI
check_if_there_is_change:
- run:
name: Check that no git-tracked files were modified
command: |
FILES_MODIFIED="$(git status --porcelain)"
if [[ -n "$FILES_MODIFIED" ]]; then
echo "The following files were modified or added during the build process:"
echo "$FILES_MODIFIED"
echo "This will likely prevent successful publishing. Please run the build locally and include these changes in your pull request)"
exit 1
fi
但它失败了
yaml.scanner.ScannerError: while scanning a simple key
in ".circleci/main.yml", line 638, column 11
could not find expected ':'
in ".circleci/main.yml", line 639, column 9
IntelliJ 在块映射中显示无效的子元素。
如何更改?我想知道文件是否已被修改。
在 YAML 中,缩进对于定义结构至关重要,键的多行值
command
必须相对于键本身进行适当缩进,以确保数据结构正确: