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

Avoid to use git config --global for setting user name and email #151

Closed
nwtgck opened this issue Mar 11, 2020 · 4 comments · Fixed by #152
Closed

Avoid to use git config --global for setting user name and email #151

nwtgck opened this issue Mar 11, 2020 · 4 comments · Fixed by #152
Assignees
Labels

Comments

@nwtgck
Copy link
Contributor

nwtgck commented Mar 11, 2020

Thank you very much for the actions.

Is your feature request related to a problem? Please describe.
For setting committer information, currently git config --global is used. However, the command affects globally.

export async function setConfig(
userName: string,
userEmail: string
): Promise<void> {
await exec.exec('git', ['config', '--global', 'gc.auto', '0']);
let name = '';
if (userName) {
name = userName;
} else {
name = `${process.env.GITHUB_ACTOR}`;
}
await exec.exec('git', ['config', '--global', 'user.name', name]);
let email = '';
if (userName !== '' && userEmail !== '') {
email = userEmail;
} else {
email = `${process.env.GITHUB_ACTOR}@users.noreply.github.com`;
}
await exec.exec('git', ['config', '--global', 'user.email', email]);
return;
}

Describe the solution you'd like
git commit --author="myname <myemail>" ... This minimizes the effects.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@peaceiris
Copy link
Owner

Thank you. That is my corner‐cutting. Do you have your implementation idea? Open your pr?

@peaceiris
Copy link
Owner

peaceiris commented Mar 11, 2020

I will open my Pull Request and add you as a co-author.

peaceiris added a commit that referenced this issue Mar 11, 2020
@peaceiris
Copy link
Owner

Open #152

peaceiris added a commit that referenced this issue Mar 12, 2020
* fix: set commit author as local config

Close #151

Co-authored-by: Ryo Ota <[email protected]>
@peaceiris peaceiris added the enhancement New feature or request label Mar 12, 2020
@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants