From fe766e27de63645f59a4d890b734dbd2ff99e735 Mon Sep 17 00:00:00 2001 From: Seth Boyles Date: Mon, 17 Aug 2026 11:40:12 -0600 Subject: [PATCH] Fix OpenAPI docs publishing pipeline not triggering Pages deploy Commits pushed to gh-pages using the default GITHUB_TOKEN don't trigger other workflows, so "Deploy V3 API Docs to Pages" never ran after "Deploy CF API V3 OpenAPI Documentation" pushed updated docs. workflow_dispatch is exempt from that restriction, so explicitly dispatch the Pages deploy workflow via the API after a successful push. Fixes cloudfoundry/cloud_controller_ng#5373 [ai-assisted=yes] --- .github/workflows/openapi_deploy.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openapi_deploy.yml b/.github/workflows/openapi_deploy.yml index f58daaa13d6..d8badf2bf40 100644 --- a/.github/workflows/openapi_deploy.yml +++ b/.github/workflows/openapi_deploy.yml @@ -17,6 +17,7 @@ jobs: image: node:24-alpine permissions: contents: write + actions: write steps: - name: Checkout main uses: actions/checkout@v7 @@ -46,10 +47,29 @@ jobs: cp -r main/docs/openapi/dist/. gh-pages/openapi/ - name: Commit and push + id: commit working-directory: gh-pages run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add openapi - git diff --cached --quiet && echo "No changes to publish" || \ - (git commit -m "Update openapi docs from ${GITHUB_SHA}" && git push) + if git diff --cached --quiet; then + echo "No changes to publish" + echo "changed=false" >> "$GITHUB_OUTPUT" + else + git commit -m "Update openapi docs from ${GITHUB_SHA}" + git push + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Trigger Pages deployment + if: steps.commit.outputs.changed == 'true' + uses: actions/github-script@v7 + with: + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'deploy_v3_docs.yml', + ref: 'gh-pages', + });