Skip to content

Commit 7f16018

Browse files
committed
chore: NO-JIRA blog channel option
1 parent 66195c9 commit 7f16018

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/send-blog-communications.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ on:
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:
@@ -71,7 +80,7 @@ jobs:
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

0 commit comments

Comments
 (0)