Olá,
Montei um workflow no GH Actions para testar o Lint porém esta retornando um erro de Permissão Negada, conforme anexo. Tentei utilizar o comando sudo para rodar as instalações mas também não funcionou.
O que fazer para o workflow funcionar?
Seguem os prints e os arquivos para verificar.
Package.json
{
"name": "websocket_server",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "nodemon server",
"build": "yarn run sucrase server",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint"
},
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"helmet": "^6.1.5",
"http": "^0.0.1-security",
"morgan": "^1.10.0",
"nodemon": "^2.0.22",
"react-router-dom": "^6.10.0",
"socket.io": "^4.6.1",
"sucrase": "^3.32.0",
"ws": "^8.13.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.1",
"eslint": "^8.39.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"typescript": "^5.0.4"
}
}
pre-push.YAML
name: pre-push
on:
push:
branches-ignore:
- main
jobs:
test:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Instala as dependencias
run: sudo npm i
- name: Roda o linter
run: sudo npm run lint
Att, Alexandre Galiotto