summaryrefslogtreecommitdiffstats
path: root/src/validate.rs
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2019-07-13 22:29:34 +0200
committerPietro Albini <pietro@pietroalbini.org>2019-07-13 22:29:34 +0200
commita584b9c783d9d922ef2583f29f6353cc015afa9c (patch)
tree54ce0286c89f7f068b64919d197ba51f38d604d1 /src/validate.rs
parentb8f0a391fedb4fb817c04ff4907336e1eece2214 (diff)
don't require the github token for add-person
Diffstat (limited to 'src/validate.rs')
-rw-r--r--src/validate.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/validate.rs b/src/validate.rs
index 82f2fee..4c4ebfb 100644
--- a/src/validate.rs
+++ b/src/validate.rs
@@ -34,19 +34,17 @@ pub(crate) fn validate(data: &Data, strict: bool) -> Result<(), Error> {
check(data, &mut errors);
}
- match GitHubApi::new() {
- Ok(github) => {
- for check in GITHUB_CHECKS {
- check(data, &github, &mut errors);
- }
+ let github = GitHubApi::new();
+ if let Err(err) = github.require_auth() {
+ if strict {
+ return Err(err);
+ } else {
+ warn!("couldn't perform checks relying on the GitHub API, some errors will not be detected");
+ warn!("cause: {}", err);
}
- Err(err) => {
- if strict {
- return Err(err);
- } else {
- warn!("couldn't perform checks relying on the GitHub API, some errors will not be detected");
- warn!("cause: {}", err);
- }
+ } else {
+ for check in GITHUB_CHECKS {
+ check(data, &github, &mut errors);
}
}