From 90dafd5c6dd95d634b375d526513b36b043b413d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 18 Apr 2024 09:20:01 -0400 Subject: [PATCH] wip: Add support for sending email on instance created, started or stopped App password created using https://myaccount.google.com/apppasswords --- .github/workflows/control-instance.yml | 24 ++++++++++++++++++++++++ .github/workflows/create-instance.yml | 12 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/.github/workflows/control-instance.yml b/.github/workflows/control-instance.yml index eec2e996..df9ae877 100644 --- a/.github/workflows/control-instance.yml +++ b/.github/workflows/control-instance.yml @@ -20,6 +20,18 @@ jobs: env: NUMBER: ${{ github.event.issue.number }} + - name: Send mail + uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0 + with: + server_address: smtp.gmail.com + server_port: 465 + secure: true + username: ${{secrets.MAIL_USERNAME}} + password: ${{secrets.MAIL_PASSWORD}} + from: MorphoCloudPortal + subject: "[MorphoCloudPortal] Instance ${{ github.event.issue.number }} started" + body: Instance ${{ github.event.issue.number }} started + stop: runs-on: self-hosted if: @@ -30,3 +42,15 @@ jobs: echo Stopping instance associated with issue $NUMBER env: NUMBER: ${{ github.event.issue.number }} + + - name: Send mail + uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0 + with: + server_address: smtp.gmail.com + server_port: 465 + secure: true + username: ${{secrets.MAIL_USERNAME}} + password: ${{secrets.MAIL_PASSWORD}} + from: MorphoCloudPortal + subject: "[MorphoCloudPortal] Instance ${{ github.event.issue.number }} stopped" + body: Instance ${{ github.event.issue.number }} stopped diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index 65cf5939..8690e67d 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -17,3 +17,15 @@ jobs: echo Creating instance associated with issue $NUMBER env: NUMBER: ${{ github.event.issue.number }} + + - name: Send mail + uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0 + with: + server_address: smtp.gmail.com + server_port: 465 + secure: true + username: ${{secrets.MAIL_USERNAME}} + password: ${{secrets.MAIL_PASSWORD}} + from: MorphoCloudPortal + subject: "[MorphoCloudPortal] Instance ${{ github.event.issue.number }} created" + body: Instance ${{ github.event.issue.number }} created