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

Method editorialWorkflowGit

packages/decap-cms-backend-azure/src/API.ts:681–704  ·  view source on GitHub ↗
(
    files: (DataFile | AssetProxy)[],
    slug: string,
    options: PersistOptions,
  )

Source from the content-addressed store, hash-verified

679 }
680
681 async editorialWorkflowGit(
682 files: (DataFile | AssetProxy)[],
683 slug: string,
684 options: PersistOptions,
685 ) {
686 const contentKey = generateContentKey(options.collectionName as string, slug);
687 const branch = branchFromContentKey(contentKey);
688 const unpublished = options.unpublished || false;
689 const subfolders = options.hasSubfolders !== false; // default to true
690
691 if (!unpublished) {
692 const items = await this.getCommitItems(files, this.branch, subfolders);
693
694 await this.uploadAndCommit(items, options.commitMessage, branch, true);
695 await this.createPullRequest(
696 branch,
697 options.commitMessage,
698 options.status || this.initialWorkflowStatus,
699 );
700 } else {
701 const items = await this.getCommitItems(files, branch, subfolders);
702 await this.uploadAndCommit(items, options.commitMessage, branch, false);
703 }
704 }
705
706 async updateUnpublishedEntryStatus(collection: string, slug: string, newStatus: string) {
707 const contentKey = generateContentKey(collection, slug);

Callers 1

persistFilesMethod · 0.95

Calls 5

getCommitItemsMethod · 0.95
uploadAndCommitMethod · 0.95
createPullRequestMethod · 0.95
generateContentKeyFunction · 0.90
branchFromContentKeyFunction · 0.90

Tested by

no test coverage detected