简体   繁体   English

Github 操作的 Actionlint 问题

[英]Actionlint issue with Github actions

I'm trying to use reviewdog/action-actionlint:v1.18.2 and I'm getting this error:我正在尝试使用reviewdog/action-actionlint:v1.18.2并且出现此错误:

 shellcheck reported issue in this script: SC2046:warning:1:35: Quote this to prevent word splitting [shellcheck]

at this line:在这一行:

run: |
          echo "COMMIT_COUNT=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)" >> $GITHUB_ENV

what should I do?我应该怎么办?

It's saying that it wants you to replace this:它是说它希望你替换这个:

echo "COMMIT_COUNT=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)" >> $GITHUB_ENV

With this:有了这个:

echo "COMMIT_COUNT=$(git rev-list "$(git describe --tags --abbrev=0)"..HEAD --count)" >> $GITHUB_ENV

This is so that if the output of git describe --tags --abbrev=0 contains a space for some reason, a space will end up in the argument to git rev-list , instead of two arguments being passed. This is so that if the output of git describe --tags --abbrev=0 contains a space for some reason, a space will end up in the argument to git rev-list , instead of two arguments being passed. I don't think the output of that particular command will ever actually contain a space, but it's a good practice to quote anyway unless you actually want splitting to happen.我认为该特定命令的 output 实际上不会包含空格,但无论如何引用都是一个好习惯,除非您真的想要拆分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM