Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Set `fetch-depth` to 0 for workflows using Sonar

Aperta
#62 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
github-actions, java
Ambito
ci-cd, tooling

Direzione di ricerca

Inizia individuando la recipe che analizza i workflow alla ricerca di actions/checkout e dell’uso di Sonar, usando come riferimento l’esempio .github/workflows/github.yml. Controlla i casi Gradle, Maven, wrapper e sonarqube-action; il lavoro è completato quando ogni step checkout corrispondente ha fetch-depth impostato su 0.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

recipe

This recipe should :

  1. Detect usages of actions/checkout and Sonar
  2. Change the fetch-depth to 0 for actions/checkout

Example pull request : https://github.com/kobylynskyi/graphql-java-codegen/pull/1061


diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml
index 78fa738a..6b6710b0 100644
--- a/.github/workflows/github.yml
+++ b/.github/workflows/github.yml
@@ -86,7 +86,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
-
+        with:
+         fetch-depth: 0
       - name: Setup Java
         uses: actions/setup-java@v1
         with:

There are a few ways to run Sonar as far as I know :

Gradle :

 ./gradlew sonarqube ...
 gradle sonarqube ...

Maven :

 mvn sonar:sonar 
 ./mvnw sonar:sonar 

Using sonarqube-action

Additional information : https://community.sonarsource.com/t/git-fetch-depth-implications/75260

Common error after results are processed:

image

Lingua principale
Java
Stelle
1
Fork
9
Merge medio
7h 23m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openrewrite/rewrite-github-actions

Tutte le issue di openrewrite/rewrite-github-actions

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.