Sanitize staging SMS usage data #246
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: Sanitize staging SMS usage data | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 22 * * *" | |
env: | |
INPUT_BUCKET_1: notification-canada-ca-staging-sms-usage-logs | |
INPUT_BUCKET_2: notification-canada-ca-staging-sms-usage-west-2-logs | |
jobs: | |
sanitize-sms-usage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- name: Install python packages | |
run: pip install -r ./scripts/sanitize_sms_usage_logs/requirements.txt | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ca-central-1 | |
- name: run script | |
run: | | |
python ./scripts/sanitize_sms_usage_logs/sanitize_sms_usage_logs.py ${INPUT_BUCKET_1} ${INPUT_BUCKET_1}-san --push | |
python ./scripts/sanitize_sms_usage_logs/sanitize_sms_usage_logs.py ${INPUT_BUCKET_2} ${INPUT_BUCKET_2}-san --push | |
- name: Notify Slack channel if this job failed | |
if: ${{ failure() }} | |
run: | | |
json="{'text':'<!here> Sanitize staging SMS usage data failed in <https://github.com/cds-snc/notification-terraform/|notification-terraform> !'}" | |
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.NOTIFY_DEV_SLACK_WEBHOOK }} |