tntons/sync-api-contract

Propagates a shared API contract (source repo) into one or more consumer repositories by opening vendor/ pull requests. Designed for the WriterBridge platform but works with any source-of-truth repo that exposes plain text/typescript files.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
source-repoRepository (owner/name) that owns the source contract. Defaults to the repository that triggered the workflow.no${{ github.repository }}
source-tokenToken used to read the source repo. Pass `secrets.GITHUB_TOKEN` from the workflow to use the default per-run token.no""
source-refGit ref (branch/tag/sha) in the source repo to read files from.no${{ github.ref }}
source-shaFull SHA of the source commit being synced. Falls back to the source-ref when the caller does not provide it. Used in default PR/commit templates.no""
source-pathsComma-separated list of paths inside the source repo to copy, relative to the repo root. Each path is copied as-is into the corresponding destination-path on the consumer.yes
consumersNewline-separated list of consumer repos in the form `owner/name:branch:token-secret:commit-author`. The token-secret is the name of the GitHub Actions secret holding a token with write access to that consumer. The commit-author is `Name <email>` for the PR commits. Example: tntons/writer-frontend:main:CONSUMER_TOKEN_FRONTEND:Frontend Bot <bot@example.com> tntons/writer-backend:main:CONSUMER_TOKEN_BACKEND:Backend Bot <bot@example.com>yes
destination-baseBase path inside each consumer repo. Files from source-paths are copied under this path. For example, if destination-base is `vendor/api-contract` and source-paths is `index.js,index.d.ts`, the consumer ends up with `vendor/api-contract/index.js` and `vendor/api-contract/index.d.ts`.yes
pr-titleTitle template for the sync PR.nochore(contract): sync from {source-repo}@{source-ref}
pr-bodyBody template for the sync PR.no This PR was opened automatically by the sync-api-contract action. Source: {source-repo}@{source-ref} Destination base: {destination-base} Please review the diff and run the project standard CI before merging. If the contract change is intentional, approve and merge. If not, close the PR and the source repo should be reverted.
pr-branchBranch name template for the sync PR.nochore/sync-api-contract
pr-labelLabel applied to sync PRs (created if missing).noapi-contract-sync
commit-messageCommit message used when updating the vendor copy.nochore(contract): sync from {source-repo}@{source-ref}
fail-on-errorIf true, the action fails the workflow when any consumer cannot be synced. If false, errors are logged and the action exits 0 so a single broken consumer does not block the others.notrue
namedescription
prs-openedNewline-separated list of consumer repos where a sync PR was opened.
prs-updatedNewline-separated list of consumer repos where an existing sync PR was updated.
prs-closedNewline-separated list of consumer repos where the sync PR was closed (no diff).
errorsNewline-separated list of consumer repos that failed to sync.