add mail wf
This commit is contained in:
parent
1e8fc873f5
commit
a1d1957d29
49
.gitea/workflows/sendQAMail.yaml
Normal file
49
.gitea/workflows/sendQAMail.yaml
Normal file
@ -0,0 +1,49 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user