|
|
@@ -0,0 +1,33 @@
|
|
|
+name: List Unhealthy Branches
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ branches:
|
|
|
+ - support/list-unhealthy-branches
|
|
|
+
|
|
|
+jobs:
|
|
|
+ list:
|
|
|
+
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+
|
|
|
+ - uses: actions/setup-node@v2
|
|
|
+ with:
|
|
|
+ node-version: '14'
|
|
|
+ check-latest: true
|
|
|
+
|
|
|
+ - name: List branches
|
|
|
+ id: list-branches
|
|
|
+ run: |
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_INACTIVE::$(node bin/github-actions/list-branches --inactive)
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_ILLEGAL::$(node bin/github-actions/list-branches --illegal)
|
|
|
+
|
|
|
+ - name: Slack Notification for inactive branches
|
|
|
+ uses: tokorom/action-slack-incoming-webhook@master
|
|
|
+ env:
|
|
|
+ INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
+ with:
|
|
|
+ text: There is some *inactive* branches on remote.
|
|
|
+ attachments: ${{ steps.list-branches.outputs.SLACK_ATTACHMENTS_INACTIVE }}
|