Send email to the user who executed the job in GitHub

Viewed 248

How could I send an email when I finish executing the Action in Github and send an email to the user who executed it? This is possible?

I have this for now, I have it at the end of my .yml file

    name: Send mail
  if: always()
  uses: dawidd6/action-send-mail@v3
  with:
    # mail server settings
    server_address: smtp.example.com
    server_port: 25
    # user credentials
    username: example@example.com
    #password: ${{ secrets.EMAIL_PASSWORD }}
    # email subject
    subject: Test ${{ github.job }} execution finished ${{ job.status }}
    # email body as text
    body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
    # comma-separated string, send email to
    to: example@example.com
    # from email name
    from: GiHub example

The problem is that I don't know how to send the mail to the user who executed the action. For example ${{ github.actor }}, but I need the email of the user not only the username.

0 Answers
Related