Skip to content

Alert Stale Branches Older Than 6 Months #49

Alert Stale Branches Older Than 6 Months

Alert Stale Branches Older Than 6 Months #49

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