Purge AWS RDS DBInstance snapshots #596
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: Purge AWS RDS DBInstance snapshots | |
on: | |
schedule: | |
# Runs at 00:30 and 12:30 | |
- cron: "30 0,12 * * *" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
AWS_REGION: us-west-2 | |
jobs: | |
purge_rds_snapshots: | |
name: Purge AWS RDS DBInstance snapshots | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to AWS | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set region ${{ env.AWS_REGION }} | |
aws configure set output json | |
- name: Purge AWS RDS DBInstance snapshots | |
run: | | |
./.github/scripts/purge-aws-rds-snapshots.sh | |
- name: Create GitHub issue on failure | |
if: ${{ failure() }} | |
run: | | |
gh issue create --title "Purge AWS RDS DBInstance snapshots workflow failed" \ | |
--body "Test failed on ${{ github.repository }}. See [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details." \ | |
--repo ${{ github.repository }} |