Skip to content

Commit

Permalink
Add !ci-nix-me command
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeee committed Jul 21, 2024
1 parent a10c120 commit d97766c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions frontend/ci-build-me/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,40 @@ const handler = async (event, req) => {
}
}

// Mina CI Build section (nix-based)
else if (
// we are creating the comment
req.body.action == "created" &&
// and this is actually a pull request
req.body.issue.pull_request &&
req.body.issue.pull_request.url &&
// and the comment contents is exactly the slug we are looking for
req.body.comment.body == "!ci-nix-me"
) {
const orgData = await getRequest(req.body.sender.organizations_url);
// and the comment author is part of the core team
if (
orgData.data.filter((org) => org.login == "MinaProtocol").length > 0
) {
const prData = await getRequest(req.body.issue.pull_request.url);
const buildkite = await runBuild(
{
sender: req.body.sender,
pull_request: prData.data,
},
"mina-nix-experimental",
{}
);
return [buildkite];
} else {
// NB: Users that are 'privately' a member of the org will not be able to trigger CI jobs
return [
"comment author is not (publically) a member of the core team",
"comment author is not (publically) a member of the core team",
];
}
}

// Mina CI Build section
else if (
// we are creating the comment
Expand Down

0 comments on commit d97766c

Please sign in to comment.