From cc89aa5c430a6bee51483cda91d0f92e7437f29e Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Wed, 1 Apr 2020 12:42:32 +0300 Subject: [PATCH] fix(open-authoring): properly delete open authoring branches (#3512) --- packages/netlify-cms-backend-github/src/API.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/netlify-cms-backend-github/src/API.ts b/packages/netlify-cms-backend-github/src/API.ts index 84192724..f394a1e6 100644 --- a/packages/netlify-cms-backend-github/src/API.ts +++ b/packages/netlify-cms-backend-github/src/API.ts @@ -712,16 +712,15 @@ export default class API { filterOpenAuthoringBranches = async (branch: string) => { try { - const contentKey = contentKeyFromBranch(branch); - const { pullRequest, collection, slug } = await this.retrieveMetadata(contentKey); + const pullRequest = await this.getBranchPullRequest(branch); const { state: currentState, merged_at: mergedAt } = pullRequest; if ( pullRequest.number !== MOCK_PULL_REQUEST && currentState === PullRequestState.Closed && mergedAt ) { - // pr was merged, delete entry - await this.deleteUnpublishedEntry(collection, slug); + // pr was merged, delete branch + await this.deleteBranch(branch); return { branch, filter: false }; } else { return { branch, filter: true };