For someone running into that error in GH actions, setting:
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
worked for me.