-
Notifications
You must be signed in to change notification settings - Fork 247
Open
Description
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:
- A preceding job (e.g., "Run spotlessApply for Wear") modifies a file to fix a style violation but still exits with a success code.
- Because source files were modified, the conditional "Auto-commit..." job is triggered.
- 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.
- 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
- Commit the change that the command made (example).
- Push the commit. The workflow should now complete successfully, as the
Auto-commit
step will have nothing to do.
Metadata
Metadata
Assignees
Labels
No labels