77 SWAGLABS_USERNAME : ${{ secrets.SWAGLABS_USERNAME }}
88 SWAGLABS_PASSWORD : ${{ secrets.SWAGLABS_PASSWORD }}
99 DISCORD_WEBHOOK_URL : ${{ secrets.DISCORD_WEBHOOK_URL }}
10- DISCORD_SCRIPT : |
11- passed="${{ steps.summary.outputs.passed }}"
12- failed="${{ steps.summary.outputs.failed }}"
13- skipped="${{ steps.summary.outputs.skipped }}"
14- total="${{ steps.summary.outputs.total }}"
15- pass_percentage=$(awk "BEGIN {print ($passed/$total)*100}")
16- fail_percentage=$(awk "BEGIN {print ($failed/$total)*100}")
17-
18- content="-----------------------------------\n\n"
19- content+="🛠️ **Job: ${{ github.job }}**\n"
20- content+="👤 **User: ${{ github.actor }}**\n"
21- content+="🌎 **Browser: ${{ matrix.browser }}**\n"
22- content+="🎉 **Passed**: ${passed}\n"
23- content+="❌ **Failed**: ${failed}\n"
24- content+="⚠️ **Skipped**: ${skipped}\n"
25- content+="📊 **Total**: ${total}\n\n"
26- content+="✅ **Pass %**: ${pass_percentage}%\n"
27- content+="❌ **Fail %**: ${fail_percentage}%\n\n"
28- content+="-----------------------------------\n\n"
29-
30- curl --location "$DISCORD_WEBHOOK_URL" \
31- --header 'Content-Type: application/json' \
32- --data-raw "{
33- \"content\": \"$content\",
34- \"username\": \"TestBot\"
35- }"
3610
3711on :
3812 workflow_dispatch :
@@ -168,7 +142,13 @@ jobs:
168142 if : always()
169143
170144 - name : Send Results to Discord
171- run : $DISCORD_SCRIPT
145+ uses : ./.github/actions/discord-summary
146+ with :
147+ passed : ${{ steps.summary.outputs.passed }}
148+ failed : ${{ steps.summary.outputs.failed }}
149+ skipped : ${{ steps.summary.outputs.skipped }}
150+ total : ${{ steps.summary.outputs.total }}
151+ browser : ${{ matrix.browser }}
172152
173153 regression_tests :
174154 name : Run Regression Tests
@@ -215,7 +195,13 @@ jobs:
215195 if : always()
216196
217197 - name : Send Results to Discord
218- run : $DISCORD_SCRIPT
198+ uses : ./.github/actions/discord-summary
199+ with :
200+ passed : ${{ steps.summary.outputs.passed }}
201+ failed : ${{ steps.summary.outputs.failed }}
202+ skipped : ${{ steps.summary.outputs.skipped }}
203+ total : ${{ steps.summary.outputs.total }}
204+ browser : ${{ matrix.browser }}
219205
220206 e2e_tests :
221207 name : Run E2E Tests
@@ -266,4 +252,10 @@ jobs:
266252 if : always()
267253
268254 - name : Send Results to Discord
269- run : $DISCORD_SCRIPT
255+ uses : ./.github/actions/discord-summary
256+ with :
257+ passed : ${{ steps.summary.outputs.passed }}
258+ failed : ${{ steps.summary.outputs.failed }}
259+ skipped : ${{ steps.summary.outputs.skipped }}
260+ total : ${{ steps.summary.outputs.total }}
261+ browser : ${{ matrix.browser }}
0 commit comments