Skip to content

Commit

Permalink
tasks/evaluate: error on PRs targeting nixos-* or nixpkgs-* branches
Browse files Browse the repository at this point in the history
A PR's target branch is easy to overlook. ofborg should complain loudly
if a nixos-* or nixpkgs-* branch is the target of a PR.
  • Loading branch information
cole-h committed Jan 16, 2021
1 parent 5b5a13e commit 080e3e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ofborg/src/tasks/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
None => String::from("master"),
};

if target_branch.starts_with("nixos-") || target_branch.starts_with("nixpkgs-") {
overall_status
.set_with_description("Improper target branch", hubcaps::statuses::State::Error)?;

info!("PR targets a nixos-* or nixpkgs-* branch");
return Ok(self.actions().skip(&job));
};

overall_status.set_with_description(
format!("Checking out {}", &target_branch).as_ref(),
hubcaps::statuses::State::Pending,
Expand Down

0 comments on commit 080e3e7

Please sign in to comment.