fix: pr deployments + remove public gits

This commit is contained in:
Andras Bacsai 2022-08-27 07:46:54 +00:00
parent e9723d3f22
commit 93246f80c4
4 changed files with 6 additions and 4 deletions

View File

@ -451,6 +451,7 @@ export async function deployApplication(request: FastifyRequest<DeployApplicatio
data: { data: {
id: buildId, id: buildId,
applicationId: id, applicationId: id,
sourceBranch: branch,
branch: application.branch, branch: application.branch,
pullmergeRequestId, pullmergeRequestId,
forceRebuild, forceRebuild,

View File

@ -9,7 +9,7 @@ export async function listSources(request: FastifyRequest) {
try { try {
const teamId = request.user?.teamId; const teamId = request.user?.teamId;
const sources = await prisma.gitSource.findMany({ const sources = await prisma.gitSource.findMany({
where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }, where: { teams: { some: { id: teamId === '0' ? undefined : teamId } }, githubApp: { gitSource: { forPublic: false } } },
include: { teams: true, githubApp: true, gitlabApp: true } include: { teams: true, githubApp: true, gitlabApp: true }
}); });
return { return {

View File

@ -146,7 +146,7 @@ export async function gitHubEvents(request: FastifyRequest<GitHubEvents>): Promi
message: 'Queued. Thank you!' message: 'Queued. Thank you!'
}; };
} else if (githubEvent === 'pull_request') { } else if (githubEvent === 'pull_request') {
const pullmergeRequestId = body.number; const pullmergeRequestId = body.number.toString();
const pullmergeRequestAction = body.action; const pullmergeRequestAction = body.action;
const sourceBranch = body.pull_request.head.ref.includes('/') ? body.pull_request.head.ref.split('/')[2] : body.pull_request.head.ref; const sourceBranch = body.pull_request.head.ref.includes('/') ? body.pull_request.head.ref.split('/')[2] : body.pull_request.head.ref;
if (!allowedActions.includes(pullmergeRequestAction)) { if (!allowedActions.includes(pullmergeRequestAction)) {

View File

@ -57,11 +57,12 @@
message: 'Secret added.', message: 'Secret added.',
type: 'success' type: 'success'
}); });
} } else {
addToast({ addToast({
message: 'Secret updated.', message: 'Secret updated.',
type: 'success' type: 'success'
}); });
}
dispatch('refresh'); dispatch('refresh');
} catch (error) { } catch (error) {
console.log(error); console.log(error);