This is my .yml file
name: Automated API tests using Postman CLI
on: push
jobs:
automated-api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Configure npm authentication
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.ACCESS_TOKEN }}" >> .npmrc
- name: Install dependencies
run: npm install server/package.json
- name: Start server
run: npm install nodemon -g && nodemon server.js &
# Install nodemon globally and run the server using nodemon
- name: Wait for server to start
run: sleep 5
# Wait for 5 seconds for the server to start up
- name: Install Postman CLI
run: |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
run: |
postman collection run "20943924-a58169dd-2df0-4d23-a442-ad0872d4ac4b"
I am trying to install dependencies of my server and run the server on github server locally and than test it with Postman CLI.But I am constantly getting the error below.
Run npm install server/package.json
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/server/package.json.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2023-04-09T13_14_19_023Z-debug-0.log
Error: Process completed with exit code 128.
I have defined a .npmrc file and gave acces to the workflow but I am stil getting the accees error.