@@ -111,30 +111,23 @@ jobs:
111111 alert :
112112 name : Alerts
113113 needs : docker
114+ # if: ${{ github.event.workflow_run.conclusion == 'failure' }}
114115 runs-on : ubuntu-latest
115116 steps :
116117 - uses : actions/checkout@v3
117118
118- # - name: Post to a Slack channel
119- # uses: 8398a7/action-slack@v3
120- # with:
121- # status: ${{ job.status }}
122- # author_name: Montoring-Slack from GitHub Actions
123- # fields: repo,message,commit,author,action,eventName,ref,workflow,took # selectable (default: repo,commit,message,author)\
124- # mention: here
125- # if_mention: failure,cancelled
126- # env:
127- # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
128- # if: always() # Pick up events even if the job fails or is canceled.
129-
130119 - name : Post to a Slack channel
131- uses : abinoda/slack-action@master
132- env :
133- SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
120+ uses : 8398a7/action-slack@v3
134121 with :
135- # message to send to slack
136- args : ' {\"channel\":\"#alert\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Repository pushed to:* ${{ github.event.repository.name }}\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Pusher:* ${{ github.event.pusher.name }}\n*Commit Message:* ${{ github.event.head_commit.message }}\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"<${{ github.event.repository.html_url }}|View Repository>\"}}]}'
137- if : success()
122+ status : ${{ job.status }}
123+ author_name : Montoring-Slack from GitHub Actions
124+ fields : repo,message,commit,author,action,eventName,ref,workflow,took # selectable (default: repo,commit,message,author)\
125+ mention : here
126+ if_mention : failure,cancelled
127+ env :
128+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
129+ if : always() # Pick up events even if the job fails or is canceled.
130+
138131
139132 # - name: Slack Notification
140133 # uses: rtCamp/action-slack-notify@v2
@@ -146,3 +139,4 @@ jobs:
146139 # SLACK_TITLE: Post Title
147140 # SLACK_USERNAME: alert
148141 # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
142+
0 commit comments