Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(actions): ko-locale label email noti webhooks #22445

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/issue-label-mailer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Issue Label Mailer

on:
issues:
types: [labeled]

jobs:
send_notification:
runs-on: ubuntu-latest

steps:
- name: Trim issue body to 3 lines
if: github.event.label.name == 'l10n-ko'
run: |
echo "${{ github.event.issue.body }}" | head -n 3 > trimmed_body.txt
echo "TRIMMED_BODY<<EOF" >> $GITHUB_ENV
while IFS= read -r line; do
echo "$line" >> $GITHUB_ENV
done < trimmed_body.txt
echo "EOF" >> $GITHUB_ENV

- name: Send Email Notification
if: github.event.label.name == 'l10n-ko'
uses: dawidd6/action-send-mail@v3
env:
TRIMMED_BODY: ${{ env.TRIMMED_BODY }}
with:
secure: true
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# Mail
subject: "[l10n-ko] ${{ github.event.issue.title }}"
body: "Issue URL: ${{ github.event.issue.html_url }}\n\nBody:\n${{env.TRIMMED_BODY}}"
to: [email protected]
from: yari-content-ko
Loading