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

50 lines
1.8 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: |
echo "Subject: Neues Release [${{ env.GITHUB_REPOSITORY }}]" > email.txt
echo "From: ${{ vars.SMTP_SENDER }}" > email.txt
echo "To: ${{ vars.SMTP_QA_RECIPIENT }}" >> email.txt
echo "" >> email.txt
echo "Ein neues Release für [${{ env.GITHUB_REPOSITORY }}] wurde erstellt." >> email.txt
echo "" >> email.txt
echo "Version: ${{ inputs.version }}" >> email.txt
echo "https://gitea.greyhound-software.com/greyhound/dashboard/milestone/${{ inputs.milestone }}" >> email.txt
echo "https://gitea.greyhound-software.com/greyhound/dashboard/releases/tag/${{ inputs.tag }}" >> email.txt
- name: Send Email
run: |
msmtp --debug ${{ vars.SMTP_QA_RECIPIENT }} < email.txt