Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTAHUB-2749] Add github-slack workflow for production PR notifications #2049

Merged
merged 8 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ commands:
\"description\": \"<< parameters.env_name >> Successfully Deployed\"
}
}"
notify_slack:
description: "Notify slack of a deploy to production"
parameters:
slack_webhook_url:
description: "Slack webhook url"
type: string
steps:
- run:
name: Notify Slack of Deployment
command: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"🚀 Deployment to production was successful!"}' \
<< parameters.slack_webhook_url >>

cf_deploy:
description: "Login to cloud foundry space with service account credentials
and push application using deployment configuration file."
Expand Down Expand Up @@ -856,6 +870,8 @@ jobs:
env_name: prod
new_relic_app_id: << pipeline.parameters.prod_new_relic_app_id >>
new_relic_api_key: $NEW_RELIC_REST_API_KEY
- notify_slack:
slack_webhook_url: $SLACK_WEBHOOK_URL
resource_class: large
workflows:
build_test_deploy:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/pr-notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pull Request Notifications

on:
pull_request:
branches:
- production
types: [ready_for_review]

jobs:
notify_slack:
runs-on: ubuntu-latest
steps:
- name: Notify slack when a PR to production is opened
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{\"text\": \":rocket: A pull request (#${{ github.event.pull_request.number }}) to *production* is now open! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number }}\"}" $SLACK_WEBHOOK_URL