"Auto-commit if spotlessApply has changes" workflow job failed unexpectedly

Aperta
#573 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@florina-muntenescu ci sta già lavorando.

Dal 30/7/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

The "Auto-commit if spotlessApply has changes" workflow job can fail with a misleading error message. While the log may suggest a non-existent branch, the root cause is often an uncommitted change from a previous step (example failure).

Root Cause

The failure is a symptom of a cascading issue:

  1. A preceding job (e.g., "Run spotlessApply for Wear") modifies a file to fix a style violation but still exits with a success code.
  2. Because source files were modified, the conditional "Auto-commit..." job is triggered.
  3. The Auto-commit job then fails due to the unexpected repository state.

This is confusing because the UI marks all previous jobs as successful, making it seem like the Auto-commit job is the only problem.

Workaround

The workaround is to run the spotlessApply tasks locally to find and commit the file modifications.

  1. Manually execute each job of the workflow until you find one that modifies a file. For example:
    ./gradlew :wear:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
    
  2. Commit the change that the command made (example).
  3. Push the commit. The workflow should now complete successfully, as the Auto-commit step will have nothing to do.
Lingua principale
Kotlin
Stelle
1.2k
Fork
448
Merge medio
4g 22h
PR unite (30g)
42

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 android/snippets

Tutte le issue di android/snippets

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.