Skip to content

Commit f5cb717

Browse files
committed
SlackNotifications
1 parent f5703d5 commit f5cb717

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/playwright.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
build:
1717
# Specify the operating system for this job
1818
runs-on: ubuntu-latest
19+
env:
20+
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}
1921

2022
# Define the steps to execute in this job
2123
steps:
@@ -45,13 +47,25 @@ jobs:
4547

4648
# Step to wait for the job to complete
4749
- name: Wait for job completion
48-
# Adjust the wait time as needed
49-
run: sleep 30s
50+
# Adjust the wait time as needed
51+
run: sleep 30s
5052
# This step should always run, even if previous steps fail
5153
if: always()
5254

5355
# Step to zip html-report folder
5456
- name: Zip HTML report
5557
run: zip -r html-report.zip html-report
5658
# This step should always run, even if previous steps fail
57-
if: always()
59+
if: always()
60+
61+
- name: Send Slack notification
62+
uses: rtCamp/action-slack-notify@v2
63+
env:
64+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
65+
SLACK_CHANNEL: '#playwright-test-reports'
66+
SLACK_USERNAME: GitHub Actions
67+
SLACK_TITLE: Playwright Tests Completed
68+
SLACK_TEXT: "Playwright tests have completed. Here is the HTML report."
69+
SLACK_FILE: ./html-report.zip
70+
# This step should always run, even if previous steps fail
71+
if: always()

0 commit comments

Comments
 (0)