sorenlouv / backport-github-action

Backport CLI tool as a Github Action
https://github.com/sqren/backport
26 stars 16 forks source link

Backport action fails with "Author identity unknown" #41

Closed sarod closed 2 years ago

sarod commented 2 years ago

Hi,

I followed the README instructions but when I run the action it fails with the following result:

 {
      "targetBranch": "xx",
      "status": "unhandled-error",
      "error": {
        "name": "SpawnError",
        "context": {
          "cmdArgs": [
            "commit",
            "--no-edit",
            "--no-verify"
          ],
          "code": 128,
          "stderr": "Author identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: empty ident name (for <runner@fv-az135-893.uqcy5m2vj4pengxy1oencsd1xf.phxx.internal.cloudapp.net>) not allowed\n",
          "stdout": ""
        }
      }
    }

It looks like the action does not set the git identity when it creates the commits. Is there some additional configuration needed?

sorenlouv commented 2 years ago

Interesting. The author is explicitly set when cherry-picking: https://github.com/sqren/backport/blob/571d44102a6083f5cc97a285dae2ce19f2329342/src/lib/git.ts#L297-L309

But it looks like the author is not specified when committing: https://github.com/sqren/backport/blob/d4016a7c861f51c6146186d8997e8f4c8250a855/src/lib/git.ts#L370-L378

I'll try to have a fix up within the next couple of days for you to try.

sorenlouv commented 2 years ago

This was released in v8.4.3. Please upgrade when you have time and let me know how it goes.

sarod commented 2 years ago

The fix works fine. Thanks