Skip to content

Commit

Permalink
read body from file if specified so
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Dec 6, 2019
1 parent 445b687 commit f50066a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
body:
- README.md
- Test of action completed successfully!
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -19,6 +24,6 @@ jobs:
username: ${{secrets.USERNAME}}
password: ${{secrets.PASSWORD}}
subject: ${{github.repository}}
body: Test of action completed successfully!
body: ${{matrix.body}}
to: ${{secrets.USERNAME}}
from: github-actions
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
description: Subject of mail message
required: true
body:
description: Body of mail message
description: Body of mail message (might be a filename to read from)
required: true
to:
description: Recipients mail addresses (separated with comma)
Expand Down
3 changes: 3 additions & 0 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
to = ENV['INPUT_TO']
from = ENV['INPUT_FROM']

# Body
body = File.exist?(body) ? File.read(body) : body

# Message
message = <<~END_OF_MESSAGE
Subject: #{subject}
Expand Down

0 comments on commit f50066a

Please sign in to comment.