From 2cad995dd57c6fa4cf1ec7bd5a545a5b303f9448 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Thu, 25 Apr 2024 15:19:31 -0700 Subject: [PATCH] Allow to skip slack message --- .github/workflows/cd-swarm-deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-swarm-deploy.yml b/.github/workflows/cd-swarm-deploy.yml index 47f7bd83..77d93ecd 100644 --- a/.github/workflows/cd-swarm-deploy.yml +++ b/.github/workflows/cd-swarm-deploy.yml @@ -28,8 +28,12 @@ on: type: string default: ubuntu-latest description: The default runner. + NOTIFY_SLACK: + required: false + type: boolean + default: true SLACK_CHANNEL: - required: true + required: false type: string description: Default slack channel to post a message ENDPOINT_ID: @@ -110,7 +114,7 @@ jobs: PORTAINER_DOMAIN: ${{ inputs.PORTAINER_DOMAIN }} - uses: ./actions/.github/actions/slack - if: always() + if: ${{ inputs.NOTIFY_SLACK == true }} name: slack notification with: MESSAGE: 'Update Service - ${{ inputs.STACK_NAME }}!\n>GitHub Action result - ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n>*Previous Image:* ${{ steps.swarm-deploy.outputs.PREVIOUS_IMAGE }}\n>*New Image:* ${{ inputs.IMAGE_TAG }}'