Skip to content

Commit e3eeeb9

Browse files
Update draft dispatch workflow (#150)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1d6aaa9 commit e3eeeb9

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

.github/workflows/dispatch-deploy-draft.yml

+2-26
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
# Determine the build branch and draft branch for dispatch.
14-
- name: Determine Dispatch Parameters
15-
run: |
16-
if [ "${{ github.event_name }}" == "pull_request" ]; then
17-
# If this workflow is kicked off by a pull request, build
18-
# a draft using the pull request base branch and PR branch.
19-
build_branch="${{ github.base_ref }}"
20-
draft_branch="${{ github.event.pull_request.head.ref }}"
21-
else
22-
if [ "$(basename ${{ github.event.ref }})" == "stage" ]; then
23-
# This was a merge to stage so kick off a build to update stage draft.
24-
build_branch=stage
25-
draft_branch=stage
26-
else
27-
# Otherwise this is a push to one of the source branches so
28-
# dispatch a build for the main draft to pick up the changes.
29-
build_branch=main
30-
draft_branch=main
31-
fi
32-
fi
33-
echo "build_branch=$build_branch" >> $GITHUB_OUTPUT
34-
echo "draft_branch=$draft_branch" >> $GITHUB_OUTPUT
35-
id: branches
36-
3713
- name: Deploy Draft
38-
uses: convictional/[email protected].1
14+
uses: convictional/[email protected].5
3915
with:
4016
owner: riptano
4117
repo: datastax-docs-site
4218
github_token: ${{ secrets.DISPATCH_GITHUB_TOKEN }}
4319
github_user: ${{ secrets.DISPATCH_GITHUB_USER }}
4420
workflow_file_name: deploy-draft.yml
45-
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 }}" }'
21+
client_payload: '{ "build_repository": "${{ github.event.repository.full_name }}", "build_branch": "${{ github.base_ref }}", "draft_branch": "${{ github.event.pull_request.head.ref }}", "pull_request_number": "${{ github.event.pull_request.number }}" }'

0 commit comments

Comments
 (0)