1
0
reusable-workflows/.gitea/workflows/sendQAMail.yaml

56 lines
2.4 KiB
YAML
Raw Normal View History

2025-01-16 11:06:20 +00:00
name: Send QA Mail
on:
workflow_call:
inputs:
version:
required: true
type: string
milestone:
required: true
type: string
tag:
required: true
type: string
jobs:
Mail:
runs-on: ubuntu-latest
steps:
- name: Install Mail Client
run: sudo apt-get update && sudo apt-get install -y msmtp
- name: Configure msmtp
run: |
echo "defaults" > ~/.msmtprc
echo "auth on" >> ~/.msmtprc
echo "tls on" >> ~/.msmtprc
echo "tls_starttls on" >> ~/.msmtprc
echo "account default" >> ~/.msmtprc
echo "host ${{ vars.SMTP_HOST }}" >> ~/.msmtprc
echo "port ${{ vars.SMTP_PORT }}" >> ~/.msmtprc
echo "user ${{ vars.SMTP_USER }}" >> ~/.msmtprc
echo "password ${{ vars.SMTP_PASSWORD }}" >> ~/.msmtprc
echo "from ${{ vars.SMTP_SENDER }}" >> ~/.msmtprc
chmod 600 ~/.msmtprc
- name: Create Email
run: |
2025-01-16 20:33:53 +00:00
echo "Subject: Neues Release: [${{ env.GITHUB_REPOSITORY#*/ }}]" > email.html
2025-01-16 19:28:26 +00:00
echo "From: ${{ vars.SMTP_SENDER }}" >> email.html
2025-01-16 11:39:31 +00:00
echo "To: ${{ vars.SMTP_QA_RECIPIENT }}" >> email.html
echo "Content-Type: text/html; charset=UTF-8" >> email.html
2025-01-16 17:40:49 +00:00
echo "Mime-Version: 1.0" >> email.html
2025-01-16 11:39:31 +00:00
echo "" >> email.html
echo "<html>" >> email.html
echo "<body>" >> email.html
2025-01-16 20:33:53 +00:00
echo "<h1>${{ env.GITHUB_REPOSITORY#*/ }} ${{ inputs.tag#*/ }}</h1>" >> email.html
echo "<h1>Ein neues <a href="https://gitea.greyhound-software.com/${{ env.GITHUB_REPOSITORY }}/releases/tag/${{ inputs.tag }}">Release</a> für <a href="https://gitea.greyhound-software.com/${{ env.GITHUB_REPOSITORY }}">${{ env.GITHUB_REPOSITORY#*/ }}</a> wurde erstellt.</h1>" >> email.html
2025-01-16 11:39:31 +00:00
echo "<p><strong>Version:</strong> ${{ inputs.version }}</p>" >> email.html
2025-01-16 11:55:09 +00:00
echo "<p><strong>Milestone:</strong> ${{ inputs.milestone }}</p>" >> email.html
2025-01-16 20:06:50 +00:00
echo "<p>Liste der gelösten Issues: <a href="https://gitea.greyhound-software.com/${{ env.GITHUB_REPOSITORY }}/milestone/${{ inputs.milestone }}">Issues</a></p>" >> email.html
2025-01-16 11:39:31 +00:00
echo "</body>" >> email.html
2025-01-16 17:40:49 +00:00
echo "</html>" >> email.html
2025-01-16 11:06:20 +00:00
- name: Send Email
run: |
2025-01-16 11:39:31 +00:00
msmtp --debug ${{ vars.SMTP_QA_RECIPIENT }} < email.html