publish_to_github
Publish API mocks to a GitHub repo you own, then deploy them to a public mock URL via Mockzilla's action. No account needed; ask the user for repo and visibility first.
Instructions
Publish mocks to one of the USER'S OWN GitHub repositories and let the Mockzilla action deploy them, giving a shareable URL at api.mockz.io/gh///. No Mockzilla account is needed: the first push registers the repository. This is the free path for a user who is not logged in, and a valid choice for one who is when they want the mocks living in a repo and reviewed like code. If they are logged in and just want a quick hosted mock, prefer deploy_mock_from_* instead, which also gives history and replays in the app.
ASK THE USER FIRST, do not guess:
WHICH REPOSITORY. It is theirs, not one you invent. It can be an existing repo, including an app repo they already have, since this only adds a services folder and a workflow.
list_github_reposshows the candidates.PRIVATE OR PUBLIC, if it has to be created.
visibilityis required and has no default. The deployed mock URL is public either way, so say so: whatever is in these responses is readable by anyone with the link.
SIDE EFFECTS: uses the user's own gh login, may create a repository, commits and pushes, and triggers a public deploy. An existing services folder is merged into, not replaced, unless replace is true; an existing workflow is never overwritten.
Mocks here are static: spec-generated or fixed responses. If the user wants real logic or state, this is the wrong tool; that needs the codegen action and a Go server, and this refuses to publish into such a repository. Keep specs small too, since a free simulation has 128MB and a big spec costs far more in memory than on disk: simplify first if needed. Then call wait_for_github_deploy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | "owner/name" of the user's repo. Created if absent. | |
| source | No | Folder to publish. Defaults to the mocks built by mock_endpoint. | |
| message | No | Commit message. | |
| replace | No | Delete the repo's existing service folder first. Default merges. | |
| visibility | Yes | Required when creating. Ask the user; there is no default. | |
| description | No | Description for a new repo. | |
| services_dir | No | Where service folders go in the repo. Defaults to "services"; use another path when adding mocks to an existing project. | services |