mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-12-27 03:23:07 +07:00
read body from file if specified so
This commit is contained in:
parent
445b6879ac
commit
f50066a2fe
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@ -8,6 +8,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
body:
|
||||||
|
- README.md
|
||||||
|
- Test of action completed successfully!
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
@ -19,6 +24,6 @@ jobs:
|
|||||||
username: ${{secrets.USERNAME}}
|
username: ${{secrets.USERNAME}}
|
||||||
password: ${{secrets.PASSWORD}}
|
password: ${{secrets.PASSWORD}}
|
||||||
subject: ${{github.repository}}
|
subject: ${{github.repository}}
|
||||||
body: Test of action completed successfully!
|
body: ${{matrix.body}}
|
||||||
to: ${{secrets.USERNAME}}
|
to: ${{secrets.USERNAME}}
|
||||||
from: github-actions
|
from: github-actions
|
@ -21,7 +21,7 @@ inputs:
|
|||||||
description: Subject of mail message
|
description: Subject of mail message
|
||||||
required: true
|
required: true
|
||||||
body:
|
body:
|
||||||
description: Body of mail message
|
description: Body of mail message (might be a filename to read from)
|
||||||
required: true
|
required: true
|
||||||
to:
|
to:
|
||||||
description: Recipients mail addresses (separated with comma)
|
description: Recipients mail addresses (separated with comma)
|
||||||
|
3
main.rb
3
main.rb
@ -13,6 +13,9 @@ body = ENV['INPUT_BODY']
|
|||||||
to = ENV['INPUT_TO']
|
to = ENV['INPUT_TO']
|
||||||
from = ENV['INPUT_FROM']
|
from = ENV['INPUT_FROM']
|
||||||
|
|
||||||
|
# Body
|
||||||
|
body = File.exist?(body) ? File.read(body) : body
|
||||||
|
|
||||||
# Message
|
# Message
|
||||||
message = <<~END_OF_MESSAGE
|
message = <<~END_OF_MESSAGE
|
||||||
Subject: #{subject}
|
Subject: #{subject}
|
||||||
|
Loading…
Reference in New Issue
Block a user