Skip to content

Commit

Permalink
SlackNotifications
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayp7 committed Feb 25, 2024
1 parent f5703d5 commit f5cb717
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
build:
# Specify the operating system for this job
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}

# Define the steps to execute in this job
steps:
Expand Down Expand Up @@ -45,13 +47,25 @@ jobs:

# Step to wait for the job to complete
- name: Wait for job completion
# Adjust the wait time as needed
run: sleep 30s
# Adjust the wait time as needed
run: sleep 30s
# This step should always run, even if previous steps fail
if: always()

# Step to zip html-report folder
- name: Zip HTML report
run: zip -r html-report.zip html-report
# This step should always run, even if previous steps fail
if: always()
if: always()

- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: '#playwright-test-reports'
SLACK_USERNAME: GitHub Actions
SLACK_TITLE: Playwright Tests Completed
SLACK_TEXT: "Playwright tests have completed. Here is the HTML report."
SLACK_FILE: ./html-report.zip
# This step should always run, even if previous steps fail
if: always()

0 comments on commit f5cb717

Please sign in to comment.