This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new ade183e3994 NIFI-15711 - Get raw commit author name if commit not tied
to any GH user (#11000)
ade183e3994 is described below
commit ade183e3994068c01073e75059eaf387fe31f5df
Author: Kamil TrysiĆski <[email protected]>
AuthorDate: Fri Mar 13 10:57:59 2026 +0100
NIFI-15711 - Get raw commit author name if commit not tied to any GH user
(#11000)
---
.../apache/nifi/github/GitHubRepositoryClient.java | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git
a/nifi-extension-bundles/nifi-github-bundle/nifi-github-extensions/src/main/java/org/apache/nifi/github/GitHubRepositoryClient.java
b/nifi-extension-bundles/nifi-github-bundle/nifi-github-extensions/src/main/java/org/apache/nifi/github/GitHubRepositoryClient.java
index 3c1af3a2c49..ca20991d8c1 100644
---
a/nifi-extension-bundles/nifi-github-bundle/nifi-github-extensions/src/main/java/org/apache/nifi/github/GitHubRepositoryClient.java
+++
b/nifi-extension-bundles/nifi-github-bundle/nifi-github-extensions/src/main/java/org/apache/nifi/github/GitHubRepositoryClient.java
@@ -474,18 +474,22 @@ public class GitHubRepositoryClient implements
GitRepositoryClient {
private GitCommit toGitCommit(final GHCommit ghCommit) throws IOException {
GitCommit commit = commitCache.getIfPresent(ghCommit.getSHA1());
- if (commit != null) {
- return commit;
- } else {
+
+ if (commit == null) {
final GHCommit.ShortInfo shortInfo = ghCommit.getCommitShortInfo();
+ final String author = ghCommit.getAuthor() != null
+ ? ghCommit.getAuthor().getLogin()
+ : shortInfo.getAuthor().getName();
+
commit = new GitCommit(
- ghCommit.getSHA1(),
- ghCommit.getAuthor().getLogin(),
- shortInfo.getMessage(),
- Instant.ofEpochMilli(shortInfo.getCommitDate().getTime()));
+ ghCommit.getSHA1(),
+ author,
+ shortInfo.getMessage(),
+ Instant.ofEpochMilli(shortInfo.getCommitDate().getTime()));
commitCache.put(ghCommit.getSHA1(), commit);
- return commit;
}
+
+ return commit;
}
private <T> T execute(final GHRequest<T> action) throws
FlowRegistryException, IOException {