Skip deleting the branch in the upstream of a forkerd repo
This commit is contained in:
parent
b1e5ead0b2
commit
dad3c0f9e0
|
@ -921,6 +921,12 @@ export class IssuesProcessor {
|
|||
}
|
||||
|
||||
const branch = pullRequest.head.ref;
|
||||
|
||||
if (
|
||||
pullRequest.head.repo === null ||
|
||||
pullRequest.head.repo.full_name ===
|
||||
`${context.repo.owner}/${context.repo.repo}`
|
||||
) {
|
||||
issueLogger.info(
|
||||
`Deleting the branch "${LoggerService.cyan(branch)}" from closed $$type`
|
||||
);
|
||||
|
@ -943,6 +949,15 @@ export class IssuesProcessor {
|
|||
)}" from $$type: ${error.message}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
issueLogger.warning(
|
||||
`Deleting the branch "${LoggerService.cyan(
|
||||
branch
|
||||
)}" has skipped because it belongs to other repo ${
|
||||
pullRequest.head.repo.full_name
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove a label from an issue or a pull request
|
||||
|
|
|
@ -2,6 +2,9 @@ export interface IPullRequest {
|
|||
number: number;
|
||||
head: {
|
||||
ref: string;
|
||||
repo: {
|
||||
full_name: string;
|
||||
} | null;
|
||||
};
|
||||
draft?: boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue