Skip to content

Dev test5

Dev test5 #12

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 }}"
PT_URL="${{ github.event.pull_request.patch_url }}"
COMT="${{ github.event.comment.body }}"
COMT_URL="${{ github.event.comment.html_url }}"
echo "Title: $TITLE" > /tmp/body.txt
echo "Description: $DESC" >> /tmp/body.txt
echo "Link: $LINK" >> /tmp/body.txt
[[ -n "$PT_URL" ]] && echo "========" >> /tmp/body.txt \
&& echo "Patch: $PT_URL" >> /tmp/body.txt \
&& curl -L "$URL" >> /tmp/body.txt
[[ -n "$COMT" ]] && echo "========" >> /tmp/body.txt \
&& echo "Comment: " >> /tmp/body.txt \
&& echo "Comment: $COMT" >> /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"