* Close notes issue when entry is deleted
(collectionName: string, slug: string)
| 1950 | * Close notes issue when entry is deleted |
| 1951 | */ |
| 1952 | async closeEntryNotesIssue(collectionName: string, slug: string): Promise<void> { |
| 1953 | try { |
| 1954 | const issue = await this.findNotesIssue(collectionName, slug, 'open'); |
| 1955 | if (issue) { |
| 1956 | await this.request(`${this.repoURL}/issues/${issue.number}`, { |
| 1957 | method: 'PATCH', |
| 1958 | body: JSON.stringify({ |
| 1959 | state: 'closed', |
| 1960 | labels: [...(issue.labels || []).map((l: { name: string }) => l.name), 'entry-deleted'], |
| 1961 | }), |
| 1962 | }); |
| 1963 | } |
| 1964 | } catch (error) { |
| 1965 | console.warn('Failed to close notes issue:', error); |
| 1966 | } |
| 1967 | } |
| 1968 | |
| 1969 | /** |
| 1970 | * Get PR metadata from branch name |
no test coverage detected