GitHub ESLint action failing with "Permission Denied" - eslint

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?
Here's a link to the pr where it's failing.

If a GitHub action fails with Permission Denied there are two possibilities:
1. You are trying to run a command that requires elevated privileges
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.
2. A shell script does not have the execute filesystem permission set
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.

Related

Github actions can not run the config.sh file in the ubuntu 20.04

I am trying to set up the GitHub actions in ubuntu. I made a folder and install the runner using my root account. Now, this is how permissions look like.
When I tried to run
sudo ./config.sh --url https://github.com/user/api --token supersecret
It gives me the error
Must not run with sudo
The solution most people say is that export RUNNER_ALLOW_RUNASROOT="1" and then run the command. But this widely accepted solution is not working for me for some reason.
And some others say create a non-root user and try to run. I tried that way too. It ends up with more errors.
How do I fix this?
I did it this way to run env ❯ sudo env RUNNER_ALLOW_RUNASROOT="1" ./run.sh
for the config just keep the same pattern, put the env at the beginning.

Facing issue with yo jhipster --force shell command

When we are trying to execute yo jhipster --force --skip-git --skip-install from jenkins shell job,
we are receiving the below output:
Easy with the sudo. Yeoman is the master around here.
since yo is a user command, there is no need to execute it with root permissions. if you're having permission errors when using yo without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
Yo is being installed in the server using docker file with the command RUN sh -c 'yo#3.1.1 --unsafe-perm=true --allow-root'
previously we were not facing this issue with the use of yo.
the jenkins shell screenshot

trying to run "brew uninstall node"

because my npm and node are giving me grief and I want to rinstall them.
Here is the message I get:
Permission denied - /usr/local/Cellar/node/0.10.32/include/node/libplatform/libplatform.h
what's with the Permissions denied?
Sometimes the permissions and/or ownership records can get messed up. Try following the instructions here or running the uninstall again with sudo.

mean.io initialising new project - owner rights

I'm trying to initialise my first MEAN project with command mean init myProject. This command returns the error :
There are 1313 files in your ~/.npm owned by root
Please change the permissions by running - chown -R whoami ~/.npm
By running this chown command I have another error Operation not permitted.
I tried to use nvm but I'm not sure if it's a good direction. If yes I have no idea how to configure it.
Could you please help me with that, I'm struggle with it since couple of days :/ Thanks
You need to run chown as root. Get your username using
whoami
Then run this replacing <username> with the one you got in the previous step
sudo chown -R <username> ~/.npm
For future reference, don't run "npm install -g" commands with sudo. If you're having permission problems, fix those first.
I had really serious problems with mean.io framework/scaffolding tool.
I know, that isn't solution for your problem but please be so kind to consider yeoman.

npm install - how to run build scripts with sufficient permissions?

I've created a node-module that has a build script that gets called after the installation.
The build script clones a git repository and copies some files of it to another folder.
The problem: on npm install, the script does not get sufficient permissions and I get the following error:
sh: ./build.js: Permission denied
How can I give the build script sufficient permissions to do its job?
I want that the users just can do npm install mymodule and the build-script then does its job on any system.
Any ideas?
Do you have the x flag on build.js?
chmod +x build.js
And the first line of your script should tell how to execute the script from the shell:
#!/usr/bin/env node

Resources