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

オープン
#573 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@florina-muntenescu がすでに取り組んでいます。

2025年7月30日 から。

評価

この issue はまだ評価されていません。

説明

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.
主要言語
Kotlin
スター
1.2k
フォーク
448
平均マージ
4日 22時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

android/snippets のほかの issue

android/snippets の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。