Created
December 21, 2022 17:23
-
-
Save ricardofiorani/48d1052bb4ea55c47c0a932295ebd9b0 to your computer and use it in GitHub Desktop.
Example of a github actions pipeline that sends an email via AWS SES when completed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Send email on pipeline completion | |
on: | |
# Trigger this workflow when the pipeline is completed | |
pipeline: | |
completed: true | |
jobs: | |
send-email: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out the code from your repository | |
- uses: actions/checkout@v2 | |
# Set up AWS credentials | |
- name: Set up AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
# Send the email using the AWS CLI | |
- name: Send email | |
run: | | |
# Replace the following placeholders with your own values | |
# SENDER_EMAIL: the email address of the sender | |
# RECIPIENT_EMAIL: the email address of the recipient | |
# SUBJECT: the subject of the email | |
# BODY: the body of the email | |
aws ses send-email \ | |
--from SENDER_EMAIL \ | |
--to RECIPIENT_EMAIL \ | |
--subject "$SUBJECT" \ | |
--text "$BODY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment