File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1010 description : ' Optional: Send to this email address instead of the production list (for testing)'
1111 required : false
1212 type : string
13+ channels :
14+ description : ' Which channels to send to'
15+ required : false
16+ type : choice
17+ default : ' all'
18+ options :
19+ - all
20+ - email
21+ - sms
1322 workflow_run :
1423 workflows : ["Deploy"]
1524 types :
7180 send-email :
7281 name : Send email
7382 runs-on : ubuntu-latest
74- if : ${{ needs.added-posts.outputs.added_posts != '[]' && needs.added-posts.outputs.added_posts != '' }}
83+ if : ${{ needs.added-posts.outputs.added_posts != '[]' && needs.added-posts.outputs.added_posts != '' && (github.event_name != 'workflow_dispatch' || github.event.inputs.channels != 'sms') }}
7584 permissions :
7685 contents : read
7786 id-token : write
@@ -143,7 +152,7 @@ jobs:
143152 jq -n \
144153 --arg to "${{ env.TO_MAIL }}" \
145154 --arg subject "[dialtone] New blog post: ${{ env.BLOG_POST_HEADING }}" \
146- --arg message "${{ env.MESSAGE_BODY }} " \
155+ --rawfile message "$FILE_PATH " \
147156 '{to: $to, subject: $subject, message: $message}' | \
148157 curl -m 70 -X POST ${{ env.API_URL }} \
149158 -H "Authorization: bearer ${{ steps.auth.outputs.id_token }}" \
@@ -153,7 +162,7 @@ jobs:
153162 send-sms :
154163 name : Send SMS
155164 runs-on : ubuntu-latest
156- if : ${{ (needs.added-posts.outputs.added_posts != '[]' && needs.added-posts.outputs.added_posts != '') && (github.event.inputs.test_email == '' || github.event_name != 'workflow_dispatch') }}
165+ if : ${{ (needs.added-posts.outputs.added_posts != '[]' && needs.added-posts.outputs.added_posts != '') && (github.event.inputs.test_email == '' || github.event_name != 'workflow_dispatch') && (github.event_name != 'workflow_dispatch' || github.event.inputs.channels != 'email') }}
157166 permissions :
158167 contents : read
159168 id-token : write
You can’t perform that action at this time.
0 commit comments