-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (51 loc) · 2.08 KB
/
running-stage-notifier.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Running Stage Notifier
on:
schedule:
- cron: "30 20 * * 1-5"
workflow_dispatch:
jobs:
list-running-stages:
name: List Running Stages
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Get a list of running stages
id: runningStages
run: |
runningStages=`run listRunningStages | grep "runningStages="`
echo $runningStages >> $GITHUB_OUTPUT
- name: Slack Notification - notify of currently running stages
uses: rtCamp/action-slack-notify@v2
if: env.SLACK_WEBHOOK != '' && steps.runningStages.outputs.runningStages != ''
env:
SLACK_MSG_AUTHOR: ${{ github.repository }}
SLACK_COLOR: ${{job.status}}
SLACK_ICON: https://github.com/${{ github.repository_owner }}.png?size=48
SLACK_TITLE: Currently Running Stages
SLACK_MESSAGE: ${{ steps.runningStages.outputs.runningStages }}
SLACK_USERNAME: ${{ github.repository }} - ${{ github.workflow }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
- name: Slack Notification - notify of failure reporting on running stages
uses: rtCamp/action-slack-notify@v2
if: env.SLACK_WEBHOOK != '' && failure()
env:
SLACK_MSG_AUTHOR: ${{ github.repository }}
SLACK_COLOR: ${{job.status}}
SLACK_ICON: https://github.com/${{ github.repository_owner }}.png?size=48
SLACK_TITLE: Failure retrieving currently running stages
SLACK_MESSAGE: Failure retrieving currently running stages
SLACK_USERNAME: ${{ github.repository }} - ${{ github.workflow }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true