Skip to content

Commit

Permalink
Revert "feat(git): make gitAuthor repo-configurable (#11539)"
Browse files Browse the repository at this point in the history
This reverts commit fb75b2f.
  • Loading branch information
rarkins committed Sep 3, 2021
1 parent ec3b5a1 commit 2c789ec
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
8 changes: 0 additions & 8 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,14 +719,6 @@ If configured, Renovate bypasses its normal major/minor/patch upgrade logic and
Beware that Renovate follows tags strictly.
For example, if you are following a tag like `next` and then that stream is released as `stable` and `next` is no longer being updated then that means your dependencies also won't be getting updated.

## gitAuthor

You can customize the Git author that's used whenever Renovate creates a commit.
The `gitAuthor` option accepts a RFC5322-compliant string.

**Note** We strongly recommend that the Git author email you use is unique to Renovate.
Otherwise, if another bot or human shares the same email and pushes to one of Renovate's branches then Renovate will mistake the branch as unmodified and potentially force push over the changes.

## gitIgnoredAuthors

Specify commit authors ignored by Renovate.
Expand Down
8 changes: 8 additions & 0 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ This should be set to a Personal Access Token (GitHub only) when `forkMode` is s
Renovate will use this token to fork the repository into the personal space of the person owning the Personal Access Token.
Renovate will then create branches on the fork and opens Pull Requests on the parent repository.

## gitAuthor

You can customize the Git author that's used whenever Renovate creates a commit.
The `gitAuthor` option accepts a RFC5322-compliant string.

**Note** We strongly recommend that the Git author email you use is unique to Renovate.
Otherwise, if another bot or human shares the same email and pushes to one of Renovate's branches then Renovate will mistake the branch as unmodified and potentially force push over the changes.

## gitNoVerify

Controls when Renovate passes the `--no-verify` flag to `git`.
Expand Down
1 change: 1 addition & 0 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ const options: RenovateOptions[] = [
name: 'gitAuthor',
description: 'Author to use for Git commits. Must conform to RFC5322.',
type: 'string',
globalOnly: true,
},
{
name: 'gitPrivateKey',
Expand Down
1 change: 0 additions & 1 deletion lib/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export async function initPlatform(config: AllConfig): Promise<AllConfig> {
logger.debug(`Using platform gitAuthor: ${String(platformInfo.gitAuthor)}`);
returnConfig.gitAuthor = platformInfo.gitAuthor;
}
// This is done for validation and will be overridden later once repo config is incorporated
setGitAuthor(returnConfig.gitAuthor);
const platformRule: HostRule = {
hostType: returnConfig.platform,
Expand Down
4 changes: 1 addition & 3 deletions lib/util/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,9 @@ export async function writeGitAuthor(): Promise<void> {
export async function setUserRepoConfig({
branchPrefix,
gitIgnoredAuthors,
gitAuthor,
}: RenovateConfig): Promise<void> {
await setBranchPrefix(branchPrefix);
config.ignoredAuthors = gitIgnoredAuthors ?? [];
setGitAuthor(gitAuthor);
}

export async function getSubmodules(): Promise<string[]> {
Expand Down Expand Up @@ -383,6 +381,7 @@ export async function syncGit(): Promise<void> {
}
logger.warn({ err }, 'Cannot retrieve latest commit');
}
await writeGitAuthor();
config.currentBranch = config.currentBranch || (await getDefaultBranch(git));
if (config.branchPrefix) {
await setBranchPrefix(config.branchPrefix);
Expand Down Expand Up @@ -734,7 +733,6 @@ export async function commitFiles({
}
const { localDir } = getGlobalConfig();
await configSigningKey(localDir);
await writeGitAuthor();
try {
await git.reset(ResetMode.HARD);
await git.raw(['clean', '-fd']);
Expand Down

0 comments on commit 2c789ec

Please sign in to comment.