Skip to content

Allow the user to overwrite the default git committer name and email #58

@josecelano

Description

@josecelano

The action is getting the committer info (name and email) from git configuration (commit command argument/env-var, local config, global config, system config). The same way Git does.

For testing, we are using a specific committer (A committer <committer@example.com>). We do it using options when we build the SimpleGit instance:

export async function newSimpleGitWithCommitterIdentity(
  gitRepoDir: GitRepoDir
): Promise<SimpleGit> {
  const options: Partial<SimpleGitOptions> = {
    baseDir: gitRepoDir.getDirPath(),
    config: [
      `user.name=${testConfiguration().git.user.name}`,
      `user.email=${testConfiguration().git.user.email}`
    ]
  }
  const git = simpleGit(options)
  return git
}

All you add to the config attribute will be passed to git commit command withe the option -c.

Should we allow the action user to overwrite the commit with a new input @yeraydavidrodriguez @da2ce7 ?

git_committer_name
git_committer_email

Right now it's possible to overwrite it by using environment variables which is the other what Git allows you to do it:

GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL

We are passing all process env vars to the child git process.

I think we can implement it. It's a very easy feature and it could be helpful in some cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions