Skip to content

Commit 028c27c

Browse files
svenefftingeroboquat
authored andcommitted
[prebuilds] ignore inverse PRs
fixes https://github.com/gitpod-io/security/issues/26
1 parent fbbec7b commit 028c27c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/server/ee/src/prebuilds/github-app.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ export class GithubApp {
350350
try {
351351
const installationId = ctx.payload.installation?.id;
352352
const cloneURL = ctx.payload.repository.clone_url;
353+
// we are only interested in PRs that want to contribute to our repo
354+
if (ctx.payload.pull_request?.base?.repo?.clone_url !== cloneURL) {
355+
log.info("Ignoring inverse PR", ctx.payload.pull_request);
356+
return;
357+
}
353358
const pr = ctx.payload.pull_request;
354359
const contextURL = pr.html_url;
355360
let { user, project } = await this.findOwnerAndProject(installationId, cloneURL);

0 commit comments

Comments
 (0)