Skip to content

Commit 46e2b48

Browse files
Update draft dispatch workflow (#601)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 5ebacbb commit 46e2b48

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,15 @@
1-
# yamllint disable
21
name: Deploy Draft
32

43
on:
54
pull_request:
65
branches:
7-
- '*'
6+
- '**'
87

98
jobs:
109
dispatch-deploy:
1110
runs-on: ubuntu-latest
1211

1312
steps:
14-
# Determine the build branch and draft branch for dispatch.
15-
- name: Determine Dispatch Parameters
16-
run: |
17-
if [ "${{ github.event_name }}" == "pull_request" ]; then
18-
# If this workflow is kicked off by a pull request, build
19-
# a draft using the pull request base branch and PR branch.
20-
build_branch="${{ github.base_ref }}"
21-
draft_branch="${{ github.event.pull_request.head.ref }}"
22-
else
23-
if [ "$(basename ${{ github.event.ref }})" == "stage" ]; then
24-
# This was a merge to stage so kick off a build to update stage draft.
25-
build_branch=stage
26-
draft_branch=stage
27-
else
28-
# Otherwise this is a push to one of the source branches so
29-
# dispatch a build for the main draft to pick up the changes.
30-
build_branch=main
31-
draft_branch=main
32-
fi
33-
fi
34-
echo "build_branch=$build_branch" >> $GITHUB_OUTPUT
35-
echo "draft_branch=$draft_branch" >> $GITHUB_OUTPUT
36-
id: branches
37-
3813
- name: Deploy Draft
3914
uses: convictional/[email protected]
4015
with:
@@ -43,4 +18,4 @@ jobs:
4318
github_token: ${{ secrets.DISPATCH_GITHUB_TOKEN }}
4419
github_user: ${{ secrets.DISPATCH_GITHUB_USER }}
4520
workflow_file_name: deploy-draft.yml
46-
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)