diff --git a/src/main/java/io/ivyteam/devops/github/GitHubRepoConfigurator.java b/src/main/java/io/ivyteam/devops/github/GitHubRepoConfigurator.java index a898b92..da5e10c 100644 --- a/src/main/java/io/ivyteam/devops/github/GitHubRepoConfigurator.java +++ b/src/main/java/io/ivyteam/devops/github/GitHubRepoConfigurator.java @@ -32,10 +32,6 @@ public boolean run() { var changed = false; var ghRepo = gitHub.get().getRepository(repo.name()); - // if (ghRepo.isPrivate()) { - // LOGGER.info("Skip " + repo.name() + " because it is private"); - // return changed; - // } if (ghRepo.isArchived()) { LOGGER.info("Skip " + repo.name() + " because it is archived"); return changed; diff --git a/src/main/java/io/ivyteam/devops/github/webhook/GitHubWebhookController.java b/src/main/java/io/ivyteam/devops/github/webhook/GitHubWebhookController.java index 66b82e6..eb0c685 100644 --- a/src/main/java/io/ivyteam/devops/github/webhook/GitHubWebhookController.java +++ b/src/main/java/io/ivyteam/devops/github/webhook/GitHubWebhookController.java @@ -106,13 +106,13 @@ record PushBean( boolean deleted) { Branch toBranch() { - // TODO louis can you fix that -> protectedBranch? not available, need to use - // rest api I think. - var shortRef = ref.replace("refs/heads/", ""); - var authoredDate = new Date(); - authoredDate = tsToDate(this.head_commit.timestamp); - var authorUserName = this.head_commit.author.username; - return new Branch(this.repository.full_name, shortRef, authorUserName, false, authoredDate); + return Branch.create() + .repository(this.repository.full_name) + .name(ref.replace("refs/heads/", "")) + .lastCommitAuthor(this.head_commit.author.username) + .protectedBranch(false) + .authoredDate(tsToDate(this.head_commit.timestamp)) + .build(); } }