forked from the-distro/ofborg
tasks/evaluate: error on PRs targeting nixos-* or nixpkgs-* branches
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.
This commit is contained in:
parent
5b5a13eb69
commit
f56bea3b10
|
@ -334,6 +334,17 @@ 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(
|
||||
"The branch you have targeted is a read-only mirror for channels. \
|
||||
Please target release-* or master.",
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue