Просмотр исходного кода

add list-unhealthy-branches workflow

Yuki Takei 5 лет назад
Родитель
Сommit
9c7b5f0541
1 измененных файлов с 33 добавлено и 0 удалено
  1. 33 0
      .github/workflows/list-unhealthy-branches.yml

+ 33 - 0
.github/workflows/list-unhealthy-branches.yml

@@ -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 }}