|
|
@@ -22,10 +22,15 @@ jobs:
|
|
|
- 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)
|
|
|
+ export SLACK_ATTACHMENTS_ILLEGAL=`node bin/github-actions/list-branches --illegal`
|
|
|
+ export SLACK_ATTACHMENTS_INACTIVE=`node bin/github-actions/list-branches --inactive`
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_ILLEGAL::$SLACK_ATTACHMENTS_ILLEGAL
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_INACTIVE::$SLACK_ATTACHMENTS_INACTIVE
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_LENGTH_ILLEGAL::(echo $SLACK_ATTACHMENTS_ILLEGAL | jq '. | length')
|
|
|
+ echo ::set-output name=SLACK_ATTACHMENTS_LENGTH_INACTIVE::$(echo $SLACK_ATTACHMENTS_INACTIVE | jq '. | length')
|
|
|
|
|
|
- name: Slack Notification for illegal named branches
|
|
|
+ if: steps.list-branches.outputs.SLACK_ATTACHMENTS_LENGTH_ILLEGAL > 0
|
|
|
uses: tokorom/action-slack-incoming-webhook@master
|
|
|
env:
|
|
|
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FOR_DEV }}
|
|
|
@@ -34,6 +39,7 @@ jobs:
|
|
|
attachments: ${{ steps.list-branches.outputs.SLACK_ATTACHMENTS_ILLEGAL }}
|
|
|
|
|
|
- name: Slack Notification for inactive branches
|
|
|
+ if: steps.list-branches.outputs.SLACK_ATTACHMENTS_LENGTH_INACTIVE > 0
|
|
|
uses: tokorom/action-slack-incoming-webhook@master
|
|
|
env:
|
|
|
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FOR_DEV }}
|