Skip to content

"nothing to commit, working tree clean Error: Invalid status code: 1" despite skip_dirty_check #396

Description

@Piedone

git-auto-commit Version

v7.0.0

Machine Type

Ubuntu (eg. ubuntu-latest)

Bug description

Despite skip_dirty_check: true, with v7.0.0 pushing an empty commit causes the following error:

nothing to commit, working tree clean
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/28e16e81777b558cc906c8750092100bbb34c5e3/index.js:17:19)
    at ChildProcess.emit (node:events:508:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/28e16e81777b558cc906c8750092100bbb34c5e3/index.js:17:19)
    at ChildProcess.emit (node:events:508:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

This is a regression with v7.0.0. With v6.0.1 this used to work. Here's a succeeding run with v6: https://github.com/Lombiq/GitHub-Actions/actions/runs/17049708039. And here's a failing one with v7: https://github.com/Lombiq/GitHub-Actions/actions/runs/18795730636/job/53635182329.

#204 might be related.

Steps to reproduce

  1. In your workflow, run git merge --strategy=ours --no-commit some-other-branch. This merges some-other-branch but leaving no changed files.
  2. Run the action with the below code.
  3. Observe the error mentioned above.
- uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
  with:
    skip_dirty_check: true

Tried solutions

Since this is an infrequently run workflow, I just merged manually. Pushing directly with git would be an alternative.

Example Workflow

The whole workflow is here: https://github.com/Lombiq/GitHub-Actions/blob/342f3f003b75f8915c8c8311f67426971e798a52/.github/workflows/tag-version.yml (run from https://github.com/Lombiq/GitHub-Actions/blob/342f3f003b75f8915c8c8311f67426971e798a52/.github/workflows/tag-version-this-repo.yml).

Relevant log output

See above.

Repository

https://github.com/Lombiq/GitHub-Actions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions