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

Method updatePullRequestLabels

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

isCMSLabelFunction · 0.90
filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected