簡體   English   中英

Github 操作的 Actionlint 問題

[英]Actionlint issue with Github actions

我正在嘗試使用reviewdog/action-actionlint:v1.18.2並且出現此錯誤:

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

在這一行:

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

我應該怎么辦?

它是說它希望你替換這個:

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

有了這個:

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. 我認為該特定命令的 output 實際上不會包含空格,但無論如何引用都是一個好習慣,除非您真的想要拆分。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM