Skip to content

Commit

Permalink
Merge pull request #2049 from HHS/kw-github-slack
Browse files Browse the repository at this point in the history
[TTAHUB-2749] Add github-slack workflow for production PR notifications
  • Loading branch information
kryswisnaskas authored Mar 25, 2024
2 parents 9a74e31 + bc38493 commit 95347f5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
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

0 comments on commit 95347f5

Please sign in to comment.