Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions server/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ pub async fn pipeline_new_pr(
pr: u64,
archs: Option<&str>,
source: JobSource,
no_fork: bool,
) -> anyhow::Result<(Pipeline, Vec<Job>)> {
match octocrab::instance()
.pulls("AOSC-Dev", "aosc-os-abbs")
Expand All @@ -288,6 +289,10 @@ pub async fn pipeline_new_pr(

let fork = pr.head.repo.as_ref().and_then(|x| x.fork).unwrap_or(false);

if fork && no_fork {
bail!("Only maintainers can start build pipelines")
}

// find lines starting with #buildit
let packages = get_packages_from_pr(&pr);
if !packages.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion server/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async fn create_pipeline_from_pr(
bot: &Bot,
) -> ResponseResult<()> {
match wait_with_send_typing(
pipeline_new_pr(pool, pr_number, archs, JobSource::Telegram(chat.0)),
pipeline_new_pr(pool, pr_number, archs, JobSource::Telegram(chat.0), false),
bot,
chat.0,
)
Expand Down
1 change: 1 addition & 0 deletions server/src/routes/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub async fn pipeline_new_pr(
payload.pr,
payload.archs.as_deref(),
JobSource::Manual,
true,
)
.await?;
Ok(Json(PipelineNewResponse { id: pipeline.id }))
Expand Down
1 change: 1 addition & 0 deletions server/src/routes/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ async fn pipeline_new_pr_impl(
pr,
archs,
api::JobSource::GitHub { pr, user: gh_user },
false,
)
.await;

Expand Down
Loading