-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GitHub workflow to run sanitizer script automatically (#1294)
- Loading branch information
Showing
3 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Sanitize production SMS usage data | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 22 * * *" | ||
|
||
env: | ||
INPUT_BUCKET_1: notification-canada-ca-production-sms-usage-logs | ||
INPUT_BUCKET_2: notification-canada-ca-production-sms-usage-west-2-logs | ||
|
||
jobs: | ||
sanitize-sms-usage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-access-key-id: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: run script | ||
run: | | ||
./scripts/sanitize_sms_usage_logs.sh ${INPUT_BUCKET_1} ${INPUT_BUCKET_1}-san | ||
./scripts/sanitize_sms_usage_logs.sh ${INPUT_BUCKET_2} ${INPUT_BUCKET_2}-san | ||
- name: Notify Slack channel if this job failed | ||
if: ${{ failure() }} | ||
run: | | ||
json="{'text':'<!here> Sanitize production 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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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: Checkout | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
|
||
- 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: | | ||
./scripts/sanitize_sms_usage_logs.sh ${INPUT_BUCKET_1} ${INPUT_BUCKET_1}-san | ||
./scripts/sanitize_sms_usage_logs.sh ${INPUT_BUCKET_2} ${INPUT_BUCKET_2}-san | ||
- 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 }} |
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