Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Commit 07b7d65

Browse files
committed
SONARGITUB-22 Do not fail analysis when GitHub account miss push permission
1 parent 77ccf5d commit 07b7d65

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/java/org/sonar/plugins/github/PullRequestFacade.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.io.BufferedReader;
2323
import java.io.File;
24+
import java.io.FileNotFoundException;
2425
import java.io.IOException;
2526
import java.io.StringReader;
2627
import java.util.HashMap;
@@ -270,6 +271,13 @@ public void createOrUpdateSonarQubeStatus(GHCommitState status, String statusDes
270271
targetUrl = lastStatus.getTargetUrl();
271272
}
272273
ghRepo.createCommitStatus(pr.getHead().getSha(), status, targetUrl, statusDescription, COMMIT_CONTEXT);
274+
} catch (FileNotFoundException e) {
275+
String msg = "Unable to set pull request status. GitHub account probably miss push permission on the repository.";
276+
if (LOG.isDebugEnabled()) {
277+
LOG.warn(msg, e);
278+
} else {
279+
LOG.warn(msg);
280+
}
273281
} catch (IOException e) {
274282
throw new IllegalStateException("Unable to update commit status", e);
275283
}

0 commit comments

Comments
 (0)