test issue 2 #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Notify 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 | |
| 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 | |
| - name: Send Email | |
| 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], [email protected]" | |
| from: "Crash Github Bot - NO REPLY" |