Skip to content

test new issue

test new issue #15

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"]
types: [opened, reopened]
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 }}"
EVENT_ACT="${{ github.event.action }}"
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 "$PT_URL" >> /tmp/body.txt
[[ -n "$COMT" ]] && echo "========" >> /tmp/body.txt \
&& echo "Comment: $COMT_URL" >> /tmp/body.txt \
&& echo "Comment: $COMT" >> /tmp/body.txt
[[ "$EVENT_ACT" == "created" ]] && echo "Comment on Issue/PR: $TITLE" > /tmp/subj.txt \
|| echo "New Issue/PR: $TITLE" > /tmp/subj.txt
cat /tmp/body.txt
cat /tmp/subj.txt
- 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: file:///tmp/subj.txt
body: file:///tmp/body.txt
to: "[email protected]"
from: "GitHub Bot"