0

I'm trying to use reviewdog/action-actionlint:v1.18.2 and I'm getting this error:

 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 ?

1 Answers1

1

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. 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.