Skip to content

Commit

Permalink
fix(send-email): Ensure valid recipient is used decoding email
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Aug 15, 2024
1 parent e8a661e commit 50c0788
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/send-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,32 @@ jobs:
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check if email is encoded
id: check_email_encryption
run: |
if [[ "$EMAIL" != *"@"* ]]; then
encoded="true"
else
encoded="false"
fi
echo "encoded=$encoded" >> $GITHUB_OUTPUT
env:
EMAIL: ${{ steps.extract.outputs.email }}

- name: Decode email
id: decode_email
uses: ./.github/actions/encode-decode-string
with:
input_string: ${{ steps.extract.outputs.email }}
encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }}
operation: "decode"
skip: ${{ steps.check_email_encryption.outputs.encoded == 'false' }}

- name: Send mail (completed)
id: send_email
uses: ./.github/actions/send-email
with:
to: ${{ steps.extract.outputs.email }}
to: ${{ steps.decode_email.outputs.output_string }}
mail_server_username: ${{secrets.MAIL_USERNAME}}
mail_server_password: ${{secrets.MAIL_PASSWORD}}
instance_name: ${{ steps.define.outputs.instance_name }}
Expand Down

0 comments on commit 50c0788

Please sign in to comment.