From a43f164945578ac9274611fa89b5906439e3c261 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 31 Jan 2023 10:35:18 -0800 Subject: [PATCH] Move docs to run on PR merge --- .github/workflows/generate-cli-api-docs.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generate-cli-api-docs.yml b/.github/workflows/generate-cli-api-docs.yml index bc079499b83..5d5be7546b8 100644 --- a/.github/workflows/generate-cli-api-docs.yml +++ b/.github/workflows/generate-cli-api-docs.yml @@ -1,12 +1,12 @@ # **what?** -# On push, if anything in core/dbt/docs or core/dbt/cli has been +# On merge, if anything in core/dbt/docs or core/dbt/cli has been # created or modified, regenerate the CLI API docs using sphinx. # **why?** # We watch for changes in core/dbt/cli because the CLI API docs rely on click # and all supporting flags/params to be generated. We watch for changes in # core/dbt/docs since any changes to sphinx configuration or any of the -# .rst files there could result in a differently build final index.html file. +# .rst files there could result in a differently built final index.html file. # **when?** # Whenever a change has been pushed to a branch, and only if there is a diff @@ -20,6 +20,8 @@ name: Generate CLI API docs on: pull_request: + types: + - closed permissions: contents: write @@ -34,7 +36,7 @@ jobs: check_gen: name: check if generation needed runs-on: ubuntu-latest - if: ${{ github.event.pull_request.head.repo.fork == false }} + if: github.event.pull_request.merged == true outputs: cli_dir_changed: ${{ steps.check_cli.outputs.cli_dir_changed }} docs_dir_changed: ${{ steps.check_docs.outputs.docs_dir_changed }} @@ -109,8 +111,9 @@ jobs: runs-on: ubuntu-latest needs: [check_gen] if: | - needs.check_gen.outputs.cli_dir_changed == 'true' - || needs.check_gen.outputs.docs_dir_changed == 'true' + (needs.check_gen.outputs.cli_dir_changed == true || + needs.check_gen.outputs.docs_dir_changed == true) && + github.event.pull_request.merged == true steps: - name: "[DEBUG] print variables"