Skip to content

Commit

Permalink
Stop requiring full commit SHA to be provided to bot
Browse files Browse the repository at this point in the history
Since we query the GitHub API for the commit to learn parents, the full
commit hash isn't necessary. It's possibly we'll need more error
handling later for invalid commits and so on but for now this should be
sufficient to make it much easier to invoke the bot.
  • Loading branch information
Mark-Simulacrum committed Jul 26, 2019
1 parent f2d67e0 commit 140a567
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions site/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,6 @@ pub fn handle_github(request: github::Request, data: &InputData) -> ServerResult
if let Some(captures) = BODY_TRY_COMMIT.captures(&body) {
if let Some(commit) = captures.get(1).map(|c| c.as_str()) {
let commit = commit.trim_start_matches("https://github.com/rust-lang/rust/commit/");
if commit.len() != 40 {
post_comment(
&data.config,
&request.issue,
"Please provide the full 40 character commit hash.",
)?;
return Ok(github::Response);
}
let client = reqwest::Client::new();
let commit_response: github::Commit = client
.get(&format!(
Expand Down

0 comments on commit 140a567

Please sign in to comment.