Skip to content

Commit

Permalink
add .github/workflows/issue-notification.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaria0619 committed Sep 19, 2024
1 parent 252c658 commit 68238ec
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/issue-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Issue Notification

on:
issues:
types: [opened, edited, reopened, closed]
issue_comment:
types: [created, edited, deleted]

jobs:
notify:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Send email notification
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.SMTP_SERVER }}
server_port: ${{ secrets.SMTP_PORT }}
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: |
GitHub Issues Notification: ${{ github.event.issue.title }}
body: |
${{ github.event_name == 'issues' &&
format('An issue has been {0} on the repository.
Issue Title: {1}
Issue Link: {2}
Action Taken: {0}', github.event.action, github.event.issue.title, github.event.issue.html_url)
|| github.event_name == 'issue_comment' &&
format('A comment has been {0} on the issue.
Issue Title: {1}
Issue Link: {2}
Comment: {3}
Action Taken: {0}', github.event.action, github.event.issue.title, github.event.issue.html_url, github.event.comment.body) }}
to: ${{ secrets.EMAIL_RECIPIENTS }}
from: ${{ secrets.EMAIL_USERNAME }}

0 comments on commit 68238ec

Please sign in to comment.