|
1 | 1 | name: Generate toolkit docs |
2 | 2 | # Description: Generate toolkit JSON from Engine API, then sync sidebar navigation. |
3 | 3 | # Flow: |
4 | | -# 1) Build the toolkit docs generator |
| 4 | +# 1) Type-check and test the toolkit docs generator |
5 | 5 | # 2) Generate toolkit JSON into toolkit-docs-generator/data/toolkits |
6 | 6 | # 3) Sync integrations sidebar _meta.tsx from toolkit-docs-generator/data/toolkits |
7 | 7 | # 4) Create or update a PR if changes were produced |
|
10 | 10 | repository_dispatch: |
11 | 11 | types: [porter_deploy_succeeded] |
12 | 12 | workflow_dispatch: |
| 13 | + inputs: |
| 14 | + pr_branch: |
| 15 | + description: "Optional isolated branch for a verification PR" |
| 16 | + required: false |
| 17 | + type: string |
13 | 18 | # 11:00 UTC = 3 AM PST / 4 AM PDT — late enough that DST drift doesn't matter. |
14 | 19 | schedule: |
15 | 20 | - cron: "0 11 * * *" |
|
48 | 53 | - name: Install dependencies |
49 | 54 | run: pnpm install --frozen-lockfile |
50 | 55 |
|
51 | | - - name: Build toolkit docs generator |
52 | | - run: pnpm build |
53 | | - working-directory: toolkit-docs-generator |
| 56 | + - name: Validate toolkit docs generator |
| 57 | + run: pnpm run toolkit-docs:check |
54 | 58 |
|
55 | 59 | - name: Generate toolkit docs |
56 | 60 | run: | |
@@ -96,22 +100,24 @@ jobs: |
96 | 100 | with: |
97 | 101 | token: ${{ secrets.DOCS_PUBLISHABLE_GH_TOKEN }} |
98 | 102 | commit-message: "[AUTO] Adding MCP Servers docs update" |
99 | | - title: "[AUTO] Adding MCP Servers docs update" |
| 103 | + title: ${{ inputs.pr_branch && '[TEST] Generated toolkit docs verification' || '[AUTO] Adding MCP Servers docs update' }} |
100 | 104 | body: | |
101 | | - This PR was generated after a Porter deploy succeeded. |
| 105 | + This PR was generated by the toolkit docs workflow. |
102 | 106 |
|
103 | 107 | - Trigger: ${{ github.event_name }} |
| 108 | + - Source ref: ${{ github.ref_name }} |
104 | 109 | - Deploy env: ${{ github.event.client_payload.env || 'unknown' }} |
105 | 110 | - Deploy SHA: ${{ github.event.client_payload.deploy_sha || 'unknown' }} |
106 | 111 | - Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
107 | 112 | # Stable branch so later runs update the open auto-PR instead of |
108 | 113 | # opening a new one each time. create-pull-request force-pushes the |
109 | 114 | # latest generated docs onto this branch. |
110 | | - branch: automation/toolkit-docs |
| 115 | + base: ${{ inputs.pr_branch && github.ref_name || github.event.repository.default_branch || 'main' }} |
| 116 | + branch: ${{ inputs.pr_branch || 'automation/toolkit-docs' }} |
111 | 117 | delete-branch: true |
112 | 118 |
|
113 | 119 | - name: Request team review |
114 | | - if: steps.cpr.outputs.pull-request-number != '' |
| 120 | + if: steps.cpr.outputs.pull-request-number != '' && (github.event_name != 'workflow_dispatch' || inputs.pr_branch == '') |
115 | 121 | continue-on-error: true |
116 | 122 | run: gh pr edit ${{ steps.cpr.outputs.pull-request-number }} --add-reviewer ArcadeAI/engineering-tools-and-dx |
117 | 123 | env: |
|
0 commit comments