Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
josecelano opened this issue Feb 21, 2022 · 2 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@josecelano
Copy link
Member

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 <[email protected]>). 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.

@josecelano josecelano added enhancement New feature or request good first issue Good for newcomers labels Feb 21, 2022
@josecelano josecelano changed the title Allow to overwrite committer name and email Allow the user to overwrite the default git committer name and email Feb 21, 2022
@josecelano josecelano mentioned this issue Feb 21, 2022
54 tasks
@da2ce7
Copy link
Contributor

da2ce7 commented Feb 21, 2022 via email

@josecelano
Copy link
Member Author

I've just moved it to milestone 1.1.0 int the roadmap. Even if it's simple maybe it is not useful. I can't think now a workflow example where you might need to use a different committer in the same workflow. We can wait until we or someone else has the need.

I also tagged it as good-first-issue. It could be a good opportunity to collaborate with the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants