Quick Overview
This workflow runs manually or daily to sync a StudioCMS integration catalog from GitHub by reading each matching repository’s README, package.json, and latest release, then safely creating or updating one deterministic StudioCMS page per integration while reporting conflicts, warnings, and proposed changes.
How it works
- Runs manually or every day at 06:00 and validates the catalog configuration (GitHub org, repo prefix, folder name, slug prefix, and preview mode).
- Looks up the target StudioCMS folder by name and creates it only when preview mode is disabled, otherwise reporting that it would be created.
- Loads existing StudioCMS pages once, lists repositories in the GitHub organization, and filters to non-fork repos that match the configured repository name prefix.
- Processes repositories sequentially and reads each repository’s README.md, package.json, and latest GitHub release.
- Builds a standardized Markdown catalog page (with ownership marker and source digest) including install instructions, links, supported operations, and release notes, and marks archived repos as drafts.
- Creates, updates, or skips the StudioCMS page based on exact slug matching and ownership checks, and records conflicts without overwriting unowned pages.
- Compiles a final report summarizing created/updated/unchanged items, preview-only actions, warnings, conflicts, and errors.
Setup
- Add GitHub API credentials with access to list the target organization’s repositories and read repository files and releases.
- Add StudioCMS API credentials with permission to read, create, and update folders and pages.
- Update the configuration values (GitHub organization, repository prefix, StudioCMS folder name, slug prefix, and max repositories) to match your catalog.
- Keep previewOnly set to true for the first run, review the report for conflicts and warnings, then set previewOnly to false to allow writes.
- Ensure the StudioCMS site does not already contain unrelated pages using the same slugs, or adjust the slug prefix/ownership marker to avoid conflicts.