aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
index b9f086a4..f272ee29 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
@@ -63,6 +63,19 @@ public class NEUIO {
}
}
+ public String getLatestCommit() {
+ try {
+ GitHub github = new GitHubBuilder().withOAuthToken(accessToken).build();
+ GHRepository repo = github.getRepositoryById("247692460");
+ for(GHCommit commit : repo.listCommits()) {
+ return commit.getSHA1();
+ }
+ } catch(IOException e) {
+ return null;
+ }
+ return "";
+ }
+
/**
* @param oldShas Map from filename (eg. BOW.json) to the sha in the local repository
* @return Map from filename to the new shas