Skip to content

Commit

Permalink
fix: better clarity on username/gitAuthor and modified branches (#32159)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
  • Loading branch information
rarkins and secustor authored Nov 4, 2024
1 parent deaa125 commit 549c3ae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
13 changes: 12 additions & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,13 @@ You can't use other filenames because Renovate only checks the default filename

## gitAuthor

You can customize the Git author that's used whenever Renovate creates a commit.
You can customize the Git author that's used whenever Renovate creates a commit, although we do not recommend this.
When this field is unset (default), Renovate will use its platform credentials (e.g. token) to learn/discover its account's git author automatically.

<!-- prettier-ignore -->
!!! note
If running as a GitHub App and using `platformCommit`, GitHub itself sets the git author in commits so you should not configure this field.

The `gitAuthor` option accepts a [RFC5322](https://datatracker.ietf.org/doc/html/rfc5322)-compliant string.
It's recommended to include a name followed by an email address, e.g.

Expand All @@ -1502,6 +1508,7 @@ Development Bot <dev-bot@my-software-company.com>
## gitIgnoredAuthors
Specify commit authors ignored by Renovate.
This field accepts [RFC5322](https://datatracker.ietf.org/doc/html/rfc5322)-compliant strings.
By default, Renovate will treat any PR as modified if another Git author has added to the branch.
When a PR is considered modified, Renovate won't perform any further commits such as if it's conflicted or needs a version update.
Expand Down Expand Up @@ -3317,6 +3324,10 @@ It does not apply when you use a Personal Access Token as credential.
When `platformCommit` is enabled, Renovate will create commits with GitHub's API instead of using `git` directly.
This way Renovate can use GitHub's [Commit signing support for bots and other GitHub Apps](https://github.blog/2019-08-15-commit-signing-support-for-bots-and-other-github-apps/) feature.

<!-- prettier-ignore -->
!!! note
When using platform commits, GitHub determines the git author string to use and Renovate's own gitAuthor is ignored.

## postUpdateOptions

Table with options:
Expand Down
9 changes: 3 additions & 6 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,12 +1243,9 @@ Otherwise, it will default to `RenovateBot/${renovateVersion} (https://github.co

## username

You may need to set a `username` if you:

- use the Bitbucket platform, or
- use a self-hosted GitHub App with CLI (required)

If you're using a Personal Access Token (PAT) to authenticate then you should not set a `username`.
The only time where `username` is required is if using `username` + `password` credentials for the `bitbucket` platform.
You don't need to configure `username` directly if you have already configured `token`.
Renovate will use the token to discover its username on the platform, including if you're running Renovate as a GitHub App.

## writeDiscoveredRepos

Expand Down
5 changes: 4 additions & 1 deletion lib/util/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,10 @@ export async function isBranchModified(
},
'branch.isModified() = true',
);
logger.debug('branch.isModified() = true');
logger.debug(
{ branchName, unrecognizedAuthors: [...includedAuthors] },
'branch.isModified() = true',
);
config.branchIsModified[branchName] = true;
setCachedModifiedResult(branchName, true);
return true;
Expand Down

0 comments on commit 549c3ae

Please sign in to comment.