From a1d1957d2996df9774c36b5cb053e21b10130ea3 Mon Sep 17 00:00:00 2001 From: Marco Maatz Date: Thu, 16 Jan 2025 12:06:20 +0100 Subject: [PATCH] add mail wf --- .gitea/workflows/sendQAMail.yaml | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitea/workflows/sendQAMail.yaml diff --git a/.gitea/workflows/sendQAMail.yaml b/.gitea/workflows/sendQAMail.yaml new file mode 100644 index 0000000..624de6a --- /dev/null +++ b/.gitea/workflows/sendQAMail.yaml @@ -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