Skip to content

Commit 46e656d

Browse files
committed
fix: skip wrong-type files during cleanup in shared folders
Fixes issue/PR files being deleted when both point to the same folder. cleanupDeletedIssues() now skips files with type=pr, and cleanupDeletedPullRequests() skips files with type=issue.
1 parent af0565b commit 46e656d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/cleanup-manager.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export class CleanupManager {
3939
for (const file of files) {
4040
// Try to get number from frontmatter first (most reliable)
4141
const properties = extractProperties(this.app, file);
42+
43+
// Skip files that belong to a different type (e.g. PRs in a shared folder)
44+
if (properties.type === "pr") {
45+
continue;
46+
}
47+
4248
let fileNumberString: string | null = null;
4349

4450
if (properties.number) {
@@ -125,6 +131,12 @@ export class CleanupManager {
125131
for (const file of files) {
126132
// Try to get number from frontmatter first (most reliable)
127133
const properties = extractProperties(this.app, file);
134+
135+
// Skip files that belong to a different type (e.g. issues in a shared folder)
136+
if (properties.type === "issue") {
137+
continue;
138+
}
139+
128140
let fileNumberString: string | null = null;
129141

130142
if (properties.number) {

0 commit comments

Comments
 (0)