Skip to content

Commit

Permalink
Mask subject and body in send-email workflow and action. #19
Browse files Browse the repository at this point in the history
Use hack described here: actions/runner#643 (comment)
  • Loading branch information
jeanpaulrsoucy committed Jan 2, 2022
1 parent 2a5fc7f commit e7b96cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/send-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
uses: actions/checkout@v2
- name: Read and set email environment
run: |
# mask subject and body
export SUBJECT=$(jq -r '.inputs.subject' $GITHUB_EVENT_PATH)
echo "subject=$SUBJECT" >> $GITHUB_ENV; echo "::add-mask::$SUBJECT"
export BODY=$(jq -r '.inputs.body' $GITHUB_EVENT_PATH)
echo "body=$BODY" >> $GITHUB_ENV; echo "::add-mask::$BODY"
# set and mask variables from mail environment file
export $(echo "$EMAIL_ENV")
echo "mail_to=$MAIL_TO" >> $GITHUB_ENV; echo "::add-mask::$MAIL_TO"
Expand All @@ -33,8 +38,8 @@ jobs:
- name: Send email
uses: ./actions/send-email
with:
subject: ${{ github.event.inputs.subject }}
body: ${{ github.event.inputs.body }}
subject: ${{ env.subject }}
body: ${{ env.body }}
to: ${{ env.mail_to }}
from: ${{ env.mail_name }}
from_alias: ${{ env.mail_alias }}
Expand Down

0 comments on commit e7b96cb

Please sign in to comment.