(
files: (DataFile | AssetProxy)[],
slug: string,
options: PersistOptions,
)
| 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); |
no test coverage detected