generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 40
35 lines (33 loc) · 1.23 KB
/
alert_stale_branches.yaml
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
name: Alert Stale Branches Older Than 6 Months
on:
workflow_dispatch:
schedule:
- cron: "13 1 1 * *"
jobs:
alert_stale_branches:
name: Alert on Stale branches
runs-on: ubuntu-latest
steps:
- name: Check Out Changes
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
fetch-depth: 0
- name: Get our Counts
id: counts
run: |
echo "MERGE_COUNT=$(./.github/scripts/alert_stale_branches/stale_branch_check.sh --mergedcount)" >> $GITHUB_OUTPUT
echo "NOT_MERGE_COUNT=$(./.github/scripts/alert_stale_branches/stale_branch_check.sh --notmergedcount)" >> $GITHUB_OUTPUT
echo "ACTION_URL=$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)" >> $GITHUB_OUTPUT
shell: bash
- name: Slack Notification
uses: ./.github/actions/notifications
with:
method: slack
title: Stale Branch Counts
message: |
Merged ${{ steps.counts.outputs.MERGE_COUNT }}
Not Merged ${{ steps.counts.outputs.NOT_MERGE_COUNT }}
icon-emoji: ':bell:'
channel: temp_branch_dump
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
color: warning