Sonar activated - Self-hosted runner limitation: unable to use npm for test coverage alongside Docker integration

Whenever I attempt to execute the (action checkout) on a self-hosted runner with npm run coverage and then after sonarqube, I encounter this error:"

docker: Error response from daemon: pull access denied for 6cd1db, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
It works fine without the checkout and npm commands. Any suggestions?

The build.yml file was structured like this:

name: Build

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Sonar Scan
    runs-on:
      - self-hosted
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 16.15.0
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - run: npm install
      - run: npm run coverage
      - uses: sonarsource/sonarqube-scan-action@master
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
      # If you wish to fail your job when the Quality Gate is red, uncomment the following lines. This would typically be used to fail a deployment.
      # We do not recommend to use this in a pull request. Prefer using pull request decoration instead.
      - uses: sonarsource/sonarqube-quality-gate-action@master
        timeout-minutes: 5
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Answer №1

When working with Node v16, it's recommended to switch from actions/checkout@v2 to actions/checkout@v3. This update is crucial as v2 does not fully support v16. Get more details on the transition here:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am hoping to incorporate the Clutch.co widget into my upcoming Next.js web project

Whenever I try to embed the code for a Clutch.co widget on my main page, it keeps showing me a "Hydration failed error." Here is the code snippet for the widget from Clutch.co: <script type="text/javascript" src="https://widget.clutch.co ...

Accessing a repository in an API endpoint with NextAuth and TypeOrm

I am currently working on a NextJS application that utilizes NextAuth and TypeORM. I am interested in retrieving a specific user or custom entity through an api endpoint, but I am unsure of the best approach to take. I would prefer not to constantly re-ini ...

Pictures failing to load correctly post Next.js compilation and running yarn start

Currently, I am utilizing Amazon S3 as a Content Delivery Network (CDN) for my application. Everything functions properly when running the application using 'yarn dev' with the domain added to the next config. Upon inspecting the src attribute of ...

Is it feasible to create a personalized shopping cart using React with Snipcart?

Currently, I am in the process of developing a new website using Next and have integrated Snipcart. The Snipcart UI incorporates Vue.js along with embedded images and an external CSS file, which unfortunately contribute to a significant increase in the pag ...

I am looking to create a route with parameters in Next.js, as well as without any parameters

I am working on a NEXTJS project and utilizing SSR for data fetching. However, I am trying to implement the following scenario: When users land on the "/" route, they should be presented with a random product detail page. But if they search for a specific ...

Ways to transform information with SWR

I have developed two essential functions to manage data retrieval and manipulation. The first function is responsible for retrieving all quotes, handling mutations, and indicating loading status. // Fetcher and the baseUrl export const baseURL = 'http ...

When the tab is switched, the URL remains the same. However, if the URL is changed,

The tabs are changing content but the URL is not being updated. Please refer to this link for a clearer explanation of my issue: https://codesandbox.io/s/mui-tabs-58y4gk Whenever I click on a tab, the URL should change accordingly (for example, clicking ...

What is the best way to create tests for pages middleware in Next.js version 12?

I have recently implemented some logic in my pages middleware using Next 12 and now I am looking to write tests for it. However, I am unsure of where to start. Can anyone point me towards a tutorial or resource that provides a comprehensive example of test ...

Tips on showing an api call response in Reactjs

I am a beginner in Reactjs and currently working with nextjs. I have been trying to integrate a "newsletter" feature into my project. I have created a component for this which is functioning properly. However, I am facing an issue with displaying the "succ ...

Personalized Shade Selection for Papyrus

Is there a method to specifically alter the color of the box-shadow for the mui Paper component? I have a black background, making the shadow not visible. I've tried createMuiTheme({ overrides: { MuiPaper: { root: { boxShadow: & ...

What is the best way to combine Bootstrap and custom CSS, specifically the home.module.css file, in a React project?

I'm currently experimenting with utilizing multiple classes to achieve an elevated button effect and a fade animation on a bootstrap card. Here's the code snippet I've been working on: import Head from 'next/head' impo ...

Utilizing Next.js and Express as middleware, I am looking to configure the routes 'localhost:3000/newpage' and 'localhost:3000/newpage/' to be treated as the same route. How can I achieve this synchronization between the

I recently started using express and next, and encountered an issue while trying to set 'localhost:3000/newpage' and 'localhost:3000/newpage/' as the same route. Whenever I add a '/' at the end, it triggers a 404 error. For d ...

Utilizing URL parameters to establish the default value of a radio button

The Objective I am in the process of developing a platform that connects buyers and sellers. When users land on my signup page, they may encounter URLs like the following: /signup /signup?accountType=buyer /signup?accountType=seller /si ...

The deployment of Next.js on Heroku failed due to webpack issues causing the build to fail

I am encountering an issue while attempting to deploy my Next.js application to Heroku using the Heroku CLI. When I run git push heroku master, I get the following error. Below is the content of my package.json file from my current setup. Despite searchi ...

Is it necessary to check the IP address along with the signature for Stripe webhook security?

My Next.js app utilizes webhooks to manage incoming customer payment events from Stripe. Following the provided example, my webhook first verifies the signature of the incoming event: const webhookSecret = process.env.SECRET_STRIPE_WEBHOOK const webhookHa ...

Unable to locate module during deployment to Vercel platform

I have developed a website using NextJS. It functions perfectly when I run it through npm run dev, but when I try to build and deploy it on Vercel, I encounter an error stating that it cannot find the module. However, the module is found without any issues ...

I'm having trouble getting Tailwind CSS colors to work with my Next.js components. Any tips on how to apply background colors

https://i.stack.imgur.com/8RGS3.png https://i.stack.imgur.com/FRTOn.png Hey there! I'm currently experimenting with using Tailwind background colors in my Next.js project. However, I'm facing an issue where the background color is not being appl ...

Error 504 'FUNCTION_INVOCATION_TIMEOUT' encountered on NextJS/Vercel deployment

Encountering an error on one of my pages after deploying to vercel, everything functions properly in dev mode. I suspect the issue lies with one of my fetch/APIs as it utilizes the data from the initial fetch request as the URL for the subsequent fetch re ...

Retrieving a single object in NEXT.JS and MongoDB can be achieved by returning just a single object

Is there a way to retrieve a single object instead of an array from the API? I am specifically looking for just a single "Event" while using MongoDB and Next.js. Currently, I always receive: [{}] But I would like to receive: {} const fetchWithId = (url ...

What is the best way to showcase information retrieved from a Route Handler in NextJS v13.4?

I have successfully utilized the new app router to create a route handler for a GET request and received the data in my console. Now, I am looking to integrate this data into NextJS v13.4. How can I achieve this? Below is the route handler I created to fe ...