Skip to content

Commit 5d885d2

Browse files
committed
Revert "security: remove SMTP email notifications"
This reverts commit a1bc8df.
1 parent a1bc8df commit 5d885d2

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
fi
135135
136136
- name: PR Agent action step
137-
uses: qodo-ai/pr-agent@42d55d4182a4839820b11b6c4d06fce855970301 # main
137+
uses: qodo-ai/pr-agent@main
138138
env:
139139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140140
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
@@ -145,3 +145,44 @@ jobs:
145145
GITHUB_ACTION_CONFIG__AUTO_DESCRIBE: "true"
146146
GITHUB_ACTION_CONFIG__AUTO_IMPROVE: "true"
147147
GITHUB_ACTION_CONFIG__HANDLE_PR_ACTIONS: '["opened", "reopened", "ready_for_review", "synchronize"]'
148+
149+
# ============================================================================
150+
# Email Notification (External Contributors)
151+
# ============================================================================
152+
email-notify:
153+
name: Email Notification
154+
if: >-
155+
(github.event_name == 'issues' || github.event_name == 'pull_request_target')
156+
&& github.actor != 'n24q02m'
157+
&& github.event.sender.type != 'Bot'
158+
runs-on: ubuntu-latest
159+
steps:
160+
- name: Harden Runner
161+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2
162+
with:
163+
egress-policy: audit
164+
165+
- name: Send email notification
166+
uses: dawidd6/action-send-mail@d38f3f7cd391cdebfe0d38efc3998b935e951c4f # v16
167+
with:
168+
server_address: smtp.gmail.com
169+
server_port: 587
170+
username: ${{ secrets.SMTP_USERNAME }}
171+
password: ${{ secrets.SMTP_PASSWORD }}
172+
subject: >-
173+
[${{ github.event.repository.name }}]
174+
${{ github.event_name == 'issues' && 'Issue' || 'PR' }}
175+
#${{ github.event.issue.number || github.event.pull_request.number }}:
176+
${{ github.event.issue.title || github.event.pull_request.title }}
177+
to: ${{ secrets.NOTIFY_EMAIL }}
178+
from: GitHub Notify <${{ secrets.SMTP_USERNAME }}>
179+
body: |
180+
${{ github.event_name == 'issues' && 'New issue' || 'New pull request' }} in ${{ github.repository }}
181+
182+
Title: ${{ github.event.issue.title || github.event.pull_request.title }}
183+
Author: ${{ github.actor }}
184+
URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
185+
Action: ${{ github.event.action }}
186+
187+
---
188+
${{ github.event.issue.body || github.event.pull_request.body || 'No description provided.' }}

0 commit comments

Comments
 (0)