Skip to content

Commit 13899cf

Browse files
committed
Update GitHub.java
1 parent 7f6dad8 commit 13899cf

File tree

1 file changed

+2
-10
lines changed
  • src/main/java/io/github/intisy/gradle/github/impl

1 file changed

+2
-10
lines changed

src/main/java/io/github/intisy/gradle/github/impl/GitHub.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,7 @@ public String getRepoOwner() {
6464
}
6565

6666
private boolean isSshKey(String key) {
67-
return key != null && (
68-
key.startsWith("ssh-rsa") ||
69-
key.startsWith("ecdsa-sha2-nistp256") ||
70-
key.startsWith("ecdsa-sha2-nistp384") ||
71-
key.startsWith("ecdsa-sha2-nistp521") ||
72-
key.startsWith("ssh-ed25519") ||
73-
key.startsWith("sk-ecdsa-sha2-nistp256@openssh.com") ||
74-
key.startsWith("sk-ssh-ed25519@openssh.com")
75-
);
67+
return key != null && key.contains("-----BEGIN") && key.contains("PRIVATE KEY");
7668
}
7769

7870
public CredentialsProvider getCredentialsProvider() {
@@ -133,7 +125,7 @@ public boolean isRepoUpToDate(File path) {
133125
.build();
134126
Git git = new Git(repository)
135127
) {
136-
git.fetch().setTransportConfigCallback(getTransportConfigCallback()).call();
128+
git.fetch().setCredentialsProvider(getCredentialsProvider()).setTransportConfigCallback(getTransportConfigCallback()).call();
137129
String branch = repository.getBranch();
138130
ObjectId localCommit = repository.resolve("refs/heads/" + branch);
139131
ObjectId remoteCommit = repository.resolve("refs/remotes/origin/" + branch);

0 commit comments

Comments
 (0)