Skip to content

Commit dec5826

Browse files
Allow Publish Docs to be run manually (#1289)
## Summary Adds a manual trigger (`workflow_dispatch`) to **Publish Docs**, so docs.vapi.ai can be republished from the Actions tab or the CLI without merging a PR. ## Why The nightly `update-openapi` job auto-merges its spec PR with the built-in `GITHUB_TOKEN`. GitHub doesn't start other workflows from events made with that token, so **Publish Docs never runs for spec updates**. New API fields therefore don't reach the live API reference until someone merges an unrelated docs PR. Example: voice simulation latency expectations shipped on Oct 3. The spec updates that added the fields merged in #1284 (Oct 3) and #1286 (Oct 6), but the last publish ran on Oct 2, so the live Create and Update Scenario pages still don't show `latencyExpectations`. ## Change Two lines in `.github/workflows/publish-docs.yml`: - add `workflow_dispatch:` under `on:`; - widen the job's `if:` guard to accept `workflow_dispatch` as well as `push`. Without this, a manual run would show as skipped. The guard also now checks `github.ref == 'refs/heads/main'` exactly instead of `contains(...)`, so a manual run can't publish another branch. The publish steps and secrets are unchanged. ## Using it Once merged, anyone with write access can run **Actions → Publish Docs → Run workflow** on `main`, or: ```bash gh workflow run publish-docs.yml --repo VapiAI/docs --ref main ``` Merging this PR also publishes everything pending on `main`, including the latest API spec. ## Not included This makes publishing possible on demand but doesn't make it automatic after the nightly spec update. Two options for the docs owners: - merge the nightly PR with a GitHub App or bot account token instead of `GITHUB_TOKEN`, so the merge triggers Publish Docs; - or add a `schedule:` to this workflow shortly after the nightly update. ## Testing `actionlint` v1.7.7 passes with no findings, and the YAML parses with both triggers. A manual trigger can only be exercised once it's on `main`, so the first real test is a manual run after merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 07749ba commit dec5826

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/workflows/publish-docs.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
78

89
jobs:
910
run:
1011
runs-on: ubuntu-latest
11-
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') && github.run_number > 1 }}
12+
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && github.run_number > 1 }}
1213
steps:
1314
- name: Checkout repository
1415
uses: actions/checkout@v4

0 commit comments

Comments
 (0)