Skip to content

Commit

Permalink
Get PR with the current head
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpessu committed Nov 19, 2023
1 parent 3e8dcf9 commit 264d7fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SarifService {

fun getPullRequests(token: String, repositoryFullName: String, branchName: String = "main"): JSONArray {
val head = "${repositoryFullName.split("/")[0]}:$branchName"
val connection = URL("https://api.github.com/repos/$repositoryFullName/pulls?state=open&ref=$head")
val connection = URL("https://api.github.com/repos/$repositoryFullName/pulls?state=open&head=$head")
.openConnection() as HttpURLConnection

connection.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,21 +254,18 @@ class SarifViewerWindowFactory : ToolWindowFactory {
root.add(ruleNode)
}

refreshButton.apply {
addActionListener {
clearJSplitPane()
populateCombo(currentBranch, token, repositoryFullName)
val map = extractSarif(token, repositoryFullName)
if (map.isEmpty()) {
displayError("No SARIF file found")
} else {
thisLogger().info("Load result for the repository $repositoryFullName and branch ${currentBranch.name}")
buildContent(map, token, repositoryFullName, currentBranch)
}
refreshButton.addActionListener {
clearJSplitPane()
populateCombo(currentBranch, token, repositoryFullName)
val map = extractSarif(token, repositoryFullName)
if (map.isEmpty()) {
displayError("No SARIF file found")
} else {
thisLogger().info("Load result for the repository $repositoryFullName and branch ${currentBranch.name}")
buildContent(map, token, repositoryFullName, currentBranch)
}
}


myList = JTree(root)

myList.isRootVisible = false
Expand Down

0 comments on commit 264d7fc

Please sign in to comment.