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

Method updatePullRequestLabels

packages/decap-cms-backend-azure/src/API.ts:734–758  ·  view source on GitHub ↗
(pullRequest: AzurePullRequest, labels: string[])

Source from the content-addressed store, hash-verified

732 }
733
734 async updatePullRequestLabels(pullRequest: AzurePullRequest, labels: string[]) {
735 const cmsLabels = pullRequest.labels.filter(l => isCMSLabel(l.name, this.cmsLabelPrefix));
736 await Promise.all(
737 cmsLabels.map(l => {
738 return this.requestText({
739 method: 'DELETE',
740 url: `${this.endpointUrl}/pullrequests/${encodeURIComponent(
741 pullRequest.pullRequestId,
742 )}/labels/${encodeURIComponent(l.id)}`,
743 });
744 }),
745 );
746
747 await Promise.all(
748 labels.map(l => {
749 return this.requestText({
750 method: 'POST',
751 url: `${this.endpointUrl}/pullrequests/${encodeURIComponent(
752 pullRequest.pullRequestId,
753 )}/labels`,
754 body: JSON.stringify({ name: l }),
755 });
756 }),
757 );
758 }
759
760 async completePullRequest(pullRequest: AzurePullRequest) {
761 const pullRequestCompletion = {

Callers 1

Calls 3

isCMSLabelFunction · 0.90
filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected