Skip to content

Commit

Permalink
split into a template for different rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiRupertti committed May 20, 2024
1 parent 4746147 commit b70dad6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/on-call-notify-bugs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: (#Bugs) On Call Notify

on:
schedule:
- cron: "0 09 * * *"

jobs:
notify:
uses: ./.github/workflows/on-call-temaplate.yml
secrets: inherit
with:
channelId: CEZ6B64UE # bugs
title: 'Plantão'
userMessage: 'estará atuando como apoio técnico essa semana'
footer: ''
21 changes: 21 additions & 0 deletions .github/workflows/on-call-notify-tech.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: (#Team-engineers) On Call Notify

# on:
# schedule:
# - cron: "0 09 * * 1"

on:
push:
branches:
- main


jobs:
notify:
uses: ./.github/workflows/on-call-temaplte.yml
secrets: inherit
with:
channelId: CEW7CLZP1 # team-engineers
title: 'On Call'
userMessage: 'está on-call essa semana'
footer: '<https://kovihq.app.opsgenie.com/settings/schedule/detail/${{matrix.scheduleId}}|Para mais detalhes>'
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
name: On Call Notify

on:
push:
branches:
- main

env:
payments_schedule_id: f8c270c0-a11e-48cc-8715-39b8b4456b4d
payments_channel: C02BSHKTVHR
workflow_call:
inputs:
channelId:
description: Slack channel id
type: string
required: true
userMessage:
description: Message to go after responder email
type: string
required: true
title:
description: Title to go After team
type: string
required: true
footer:
description: Message Footer
type: string
required: true

jobs:
prepare:
Expand Down Expand Up @@ -53,12 +64,12 @@ jobs:
name: Send slack message
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: ${{env.payments_channel}}
SLACK_CHANNEL: ${{inputs.channelId}}
SLACK_ICON: https://avatars.githubusercontent.com/u/47012371?s=150&v=4
SLACK_TITLE: '${{matrix.team}} On Call'
SLACK_MESSAGE: '${{ fromJson(steps.oncall.outputs.response).data.onCallParticipants[0].name }} está on-call essa semana'
SLACK_TITLE: '${{matrix.team}} - ${{inputs.title}}'
SLACK_MESSAGE: '${{ fromJson(steps.oncall.outputs.response).data.onCallParticipants[0].name }} ${{inputs.userMessage}}'
SLACK_USERNAME: 'on-call-bot'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEPLOY }}
MSG_MINIMAL: true
SLACK_MSG_AUTHOR: kovihq
SLACK_FOOTER: '<https://kovihq.app.opsgenie.com/settings/schedule/detail/${{matrix.scheduleId}}|Para mais detalhes>'
SLACK_FOOTER: ${{inputs.footer}}

0 comments on commit b70dad6

Please sign in to comment.