diff --git a/.github/workflows/deploy_helm_chart.yml b/.github/workflows/deploy_helm_chart.yml index 0911b4a..ce69f64 100644 --- a/.github/workflows/deploy_helm_chart.yml +++ b/.github/workflows/deploy_helm_chart.yml @@ -115,7 +115,7 @@ on: jobs: diff: runs-on: ubuntu-latest - if: ${{ !contains(format('{0}/{1}', 'refs/heads', inputs.deploy_branch ), github.ref ) }} + # if: ${{ !contains(format('{0}/{1}', 'refs/heads', inputs.deploy_branch ), github.ref ) }} environment: ${{ inputs.environment }} permissions: contents: read @@ -333,43 +333,28 @@ jobs: echo "LAST_COMMIT_MSG=$LAST_COMMIT_MSG" >> $GITHUB_ENV - name: Send notification - uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1 + uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 #3.0.1 id: send_notification if: ${{ fromJson( inputs.slack_notification_enabled ) }} with: - channel-id: ${{ inputs.slack_channel_id }} + method: 'chat.postMessage' + token: ${{ secrets.slack_token }} payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "${{ inputs.chart_name }} ${{ inputs.environment }} deployment started (In Progress)", - "emoji": true - } - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Status:*\n:large_yellow_square: In Progress" - }, - { - "type": "mrkdwn", - "text": "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}" - }, - { - "type": "mrkdwn", - "text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.slack_token }} + channel: ${{ inputs.slack_channel_id }} + blocks: + - type: "header" + text: + type: "plain_text" + text: "${{ inputs.chart_name }} ${{ inputs.environment }} deployment started (In Progress)" + emoji: true + - type: "section" + fields: + - type: "mrkdwn" + text: "*Status:*\n:large_yellow_square: In Progress" + - type: "mrkdwn" + text: "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}" + - type: "mrkdwn" + text: "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>" - name: Deploy Helm uses: bitovi/github-actions-deploy-eks-helm@29f556cf128eb1b42f834caf13b60a630ee2a20b # v1.2.12 @@ -419,40 +404,24 @@ jobs: - name: Update notification if: ${{ always() && fromJson( inputs.slack_notification_enabled ) }} - uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1 + uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 #3.0.1 with: - channel-id: ${{ inputs.slack_channel_id }} - update-ts: ${{ steps.send_notification.outputs.ts }} + method: 'chat.update' + token: ${{ secrets.slack_token }} payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "${{ inputs.chart_name }} ${{ inputs.environment }} deployment finished (Completed)", - "emoji": true - } - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Status:*\n${{ steps.deploy.outcome == 'success' && ':white_check_mark: Success' || ':x: Failure '}}" - }, - { - "type": "mrkdwn", - "text": "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}" - }, - { - "type": "mrkdwn", - "text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.slack_token }} - \ No newline at end of file + channel: ${{ inputs.slack_channel_id }} + ts: ${{ steps.send_notification.outputs.ts }} + blocks: + - type: "header" + text: + type: "plain_text" + text: "${{ inputs.chart_name }} ${{ inputs.environment }} deployment finished (Completed)" + emoji: true + - type: "section" + fields: + - type: "mrkdwn" + text: "*Status:*\n${{ steps.deploy.outcome == 'success' && ':white_check_mark: Success' || ':x: Failure '}}" + - type: "mrkdwn" + text: "*Last Commit Message:*\n${{ env.LAST_COMMIT_MSG }}" + - type: "mrkdwn" + text: "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"