@@ -48,20 +48,35 @@ jobs:
4848
4949 - name : Send Slack notification (Success)
5050 if : steps.pr-info.outputs.found == 'true'
51- uses : rtCamp/action-slack-notify@v2
51+ run : |
52+ curl -X POST -H 'Content-type: application/json' --data '{
53+ "attachments": [{
54+ "color": "#36a64f",
55+ "blocks": [
56+ {
57+ "type": "header",
58+ "text": {"type": "plain_text", "text": "✅ Dependabot Update - CI Passed", "emoji": true}
59+ },
60+ {
61+ "type": "section",
62+ "fields": [
63+ {"type": "mrkdwn", "text": "*Repository:*\n${{ github.repository }}"},
64+ {"type": "mrkdwn", "text": "*PR:*\n<${{ steps.pr-info.outputs.pr_url }}|#${{ steps.pr-info.outputs.pr_number }}>"}
65+ ]
66+ },
67+ {
68+ "type": "section",
69+ "text": {"type": "mrkdwn", "text": "${{ steps.pr-info.outputs.pr_title }}"}
70+ },
71+ {
72+ "type": "context",
73+ "elements": [{"type": "mrkdwn", "text": "Auto-merge enabled • logzio-python-handler CI"}]
74+ }
75+ ]
76+ }]
77+ }' "$SLACK_WEBHOOK"
5278 env :
5379 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
54- SLACK_COLOR : " #36a64f"
55- SLACK_USERNAME : " Dependabot"
56- SLACK_ICON : " https://avatars.githubusercontent.com/in/29110?s=64&v=4"
57- SLACK_TITLE : " ✅ Dependabot Update - CI Passed"
58- SLACK_MESSAGE : |
59- *Repository:* ${{ github.repository }}
60- *PR:* <${{ steps.pr-info.outputs.pr_url }}|#${{ steps.pr-info.outputs.pr_number }}> ${{ steps.pr-info.outputs.pr_title }}
61- *Status:* All CI checks passed! Auto-merge has been enabled.
62-
63- The PR will be automatically merged once all branch protection requirements are satisfied.
64- SLACK_FOOTER : " logzio-python-handler CI"
6580
6681
6782 notify-failure :
@@ -101,20 +116,35 @@ jobs:
101116
102117 - name : Send Slack notification (Failure)
103118 if : steps.pr-info.outputs.found == 'true'
104- uses : rtCamp/action-slack-notify@v2
119+ run : |
120+ curl -X POST -H 'Content-type: application/json' --data '{
121+ "attachments": [{
122+ "color": "#ff0000",
123+ "blocks": [
124+ {
125+ "type": "header",
126+ "text": {"type": "plain_text", "text": "🚨 Dependabot Update - CI Failed", "emoji": true}
127+ },
128+ {
129+ "type": "section",
130+ "fields": [
131+ {"type": "mrkdwn", "text": "*Repository:*\n${{ github.repository }}"},
132+ {"type": "mrkdwn", "text": "*PR:*\n<${{ steps.pr-info.outputs.pr_url }}|#${{ steps.pr-info.outputs.pr_number }}>"}
133+ ]
134+ },
135+ {
136+ "type": "section",
137+ "text": {"type": "mrkdwn", "text": "${{ steps.pr-info.outputs.pr_title }}\n\n<${{ steps.run-url.outputs.url }}|View CI Run> to investigate"}
138+ },
139+ {
140+ "type": "context",
141+ "elements": [{"type": "mrkdwn", "text": "Manual intervention required • logzio-python-handler CI"}]
142+ }
143+ ]
144+ }]
145+ }' "$SLACK_WEBHOOK"
105146 env :
106147 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
107- SLACK_COLOR : " #ff0000"
108- SLACK_USERNAME : " Dependabot"
109- SLACK_ICON : " https://avatars.githubusercontent.com/in/29110?s=64&v=4"
110- SLACK_TITLE : " 🚨 Dependabot Update - CI Failed"
111- SLACK_MESSAGE : |
112- *Repository:* ${{ github.repository }}
113- *PR:* <${{ steps.pr-info.outputs.pr_url }}|#${{ steps.pr-info.outputs.pr_number }}> ${{ steps.pr-info.outputs.pr_title }}
114- *Status:* CI checks failed - manual intervention required!
115-
116- <${{ steps.run-url.outputs.url }}|View CI Run> to investigate the failure.
117- SLACK_FOOTER : " logzio-python-handler CI"
118148
119149 notify-merged :
120150 name : Notify Merged
@@ -126,17 +156,29 @@ jobs:
126156
127157 steps :
128158 - name : Send Slack notification (Merged)
129- uses : rtCamp/action-slack-notify@v2
159+ run : |
160+ curl -X POST -H 'Content-type: application/json' --data '{
161+ "attachments": [{
162+ "color": "#2eb886",
163+ "blocks": [
164+ {
165+ "type": "header",
166+ "text": {"type": "plain_text", "text": "🎉 Dependencies Updated Successfully", "emoji": true}
167+ },
168+ {
169+ "type": "section",
170+ "fields": [
171+ {"type": "mrkdwn", "text": "*Repository:*\n${{ github.repository }}"},
172+ {"type": "mrkdwn", "text": "*Commit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.event.workflow_run.head_sha }}|${{ github.event.workflow_run.head_sha }}>"}
173+ ]
174+ },
175+ {
176+ "type": "context",
177+ "elements": [{"type": "mrkdwn", "text": "Merged to main • logzio-python-handler CI"}]
178+ }
179+ ]
180+ }]
181+ }' "$SLACK_WEBHOOK"
130182 env :
131183 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
132- SLACK_COLOR : " #2eb886"
133- SLACK_USERNAME : " Dependabot"
134- SLACK_ICON : " https://avatars.githubusercontent.com/in/29110?s=64&v=4"
135- SLACK_TITLE : " 🎉 Dependencies Updated Successfully"
136- SLACK_MESSAGE : |
137- *Repository:* ${{ github.repository }}
138- *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.event.workflow_run.head_sha }}|${{ github.event.workflow_run.head_sha }}>
139-
140- Dependabot updates have been merged and CI passed on main branch.
141- SLACK_FOOTER : " logzio-python-handler CI"
142184
0 commit comments