reviewdogのmisspellとalexでエラーが発生したのを解決した件

事象

本日PullRequestした際の、CIでreviewdog/misspellとreviewdog/alexのエラーが発生

reviewdog: PullRequest needs 'git' command: failed to run 'git rev-parse --show-prefix': exit status 128

reviewdogのイシューも立ってるようで、割とリアルタイムにコミットされてそうなので、 このまま順調にマージされれば、対応版がすぐ出てきそうな雰囲気ですね。

https://github.com/reviewdog/reviewdog/issues/1158

解決策(暫定)

CIのyamlに下記を追記

 - run: sudo chown -R root:root $GITHUB_WORKSPACE

全体

  misspell:
    name: runner / misspell
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: sudo chown -R root:root $GITHUB_WORKSPACE
      - uses: reviewdog/action-misspell@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          level: warning
          locale: "US"

  alex:
    name: runner / alex
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: sudo chown -R root:root $GITHUB_WORKSPACE
      - uses: reviewdog/action-alex@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          level: warning

原因

Githubのセキュリティ アップデートが4/12にあったようで、これの影響ということらしい。

Git security vulnerability announced | The GitHub Blog

Cannot add parent directory to safe.directory on git - Stack Overflow