I'm writing a CI workflow (GitHub actions), and it seems that eslint is failing with "Permission Denied" code 126. I can't seem to fix it.
Can someone explain why ESlint is failing with permission denied? If so, is there a solution?
I'm writing a CI workflow (GitHub actions), and it seems that eslint is failing with "Permission Denied" code 126. I can't seem to fix it.
Can someone explain why ESlint is failing with permission denied? If so, is there a solution?
If a GitHub action fails with Permission Denied there are two possibilities:
To solve this just prefix sudo. E.g. npx eslint > sudo npx eslint. The GitHub Docs specify:
The Linux and macOS virtual machines both run using passwordless sudo.
If you have a unix/bash shell handy, you can change that with:
chmod +x ./.github/scripts/xxx.sh
If not, you can tell git to add the permission with this command:
git update-index --chmod=+x ./.github/scripts/xxx.sh
update-index is similar to add in that it adds the change to the index, so you'll have to commit and push as usual.