Skip to content

Dev test5

Dev test5 #8

Workflow file for this run

name: Notify Mailing List of GitHub Issues and PRs
on:
issues:
types: [opened]
issue_comment:
types: [created]
pull_request:
branches: ["master"]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Generate email body
run: |
TITLE="${{ github.event.issue.title || github.event.pull_request.title }}"
LINK="${{ github.event.issue.html_url || github.event.pull_request.html_url }}"
DESC="${{ github.event.issue.body || github.event.pull_request.body }}"
URL="${{ github.event.pull_request.patch_url }}"
echo "Title: $TITLE" > /tmp/body.txt
echo "Description: $DESC" >> /tmp/body.txt
echo "Link: $LINK" >> /tmp/body.txt
echo "---" >> /tmp/body.txt
[ -n "$URL" ] && curl -L "$URL" >> /tmp/body.txt
cat /tmp/body.txt
echo "${{ toJSON(github.event) }}"
- name: Send Email Notification
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.EMAIL_USER }}
password: ${{ secrets.EMAIL_PASS }}
subject: "New Issue/PR: ${{ github.event.issue.title || github.event.pull_request.title }}"
body: file:///tmp/body.txt
to: "[email protected]"
from: "GitHub Bot"