MCPcopy Create free account
hub / github.com/decaporg/decap-cms / findEntryIssue

Method findEntryIssue

packages/decap-cms-backend-github/src/API.ts:1630–1647  ·  view source on GitHub ↗

* Find existing issue for an entry (returns null if not found)

(collectionName: string, slug: string)

Source from the content-addressed store, hash-verified

1628 * Find existing issue for an entry (returns null if not found)
1629 */
1630 async findEntryIssue(collectionName: string, slug: string): Promise<GitHubIssue | null> {
1631 // Search for existing issue
1632 const searchQuery = `repo:${this.repo} label:${API.NOTES_LABEL} "${collectionName}/${slug}" in:body`;
1633
1634 try {
1635 const searchResponse = await this.request('/search/issues', {
1636 params: { q: searchQuery },
1637 });
1638
1639 if (searchResponse.items && searchResponse.items.length > 0) {
1640 return searchResponse.items[0];
1641 }
1642 return null;
1643 } catch (error) {
1644 console.warn('Failed to search for existing notes issue:', error);
1645 return null;
1646 }
1647 }
1648 /**
1649 * Get issue with ETag support for conditional requests
1650 * Returns { status: 304 } if not modified, or { status: 200, data, etag } if modified

Callers 2

getEntryNotesMethod · 0.95
addNoteToEntryMethod · 0.95

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected