From 967717b2f3420c1557c77f8c8301cf749354c19d Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Mon, 6 May 2024 22:22:25 -0700 Subject: [PATCH] Add workflow for pull request draft builds --- .github/workflows/dispatch-deploy-draft.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dispatch-deploy-draft.yml b/.github/workflows/dispatch-deploy-draft.yml index d0632b36..dbbbf7b8 100644 --- a/.github/workflows/dispatch-deploy-draft.yml +++ b/.github/workflows/dispatch-deploy-draft.yml @@ -1,11 +1,6 @@ -name: Dispatch Deploy Draft +name: Deploy Draft on: - push: - branches: - - 'main' - - 'stage' - # Add additional content source branches here pull_request: branches: - '*' @@ -20,7 +15,7 @@ jobs: run: | if [ "${{ github.event_name }}" == "pull_request" ]; then # If this workflow is kicked off by a pull request, build - # a draft using the pull resource base branch and PR branch. + # a draft using the pull request base branch and PR branch. build_branch="${{ github.base_ref }}" draft_branch="${{ github.event.pull_request.head.ref }}" else @@ -39,12 +34,12 @@ jobs: echo "draft_branch=$draft_branch" >> $GITHUB_OUTPUT id: branches - - name: Dispatch Deploy Draft + - name: Deploy Draft uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: riptano repo: datastax-docs-site github_token: ${{ secrets.DISPATCH_GITHUB_TOKEN }} - github_user: mlr + github_user: ${{ secrets.DISPATCH_GITHUB_USER }} workflow_file_name: deploy-draft.yml client_payload: '{ "build_repository": "${{ github.event.repository.full_name }}", "build_branch": "${{ steps.branches.outputs.build_branch }}", "draft_branch": "${{ steps.branches.outputs.draft_branch }}", "pull_request_number": "${{ github.event.pull_request.number }}" }'