Skip to content

Commit

Permalink
updated workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashavant1629 committed Jan 3, 2024
1 parent 8cad9a5 commit 620c5fc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ui-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,16 @@ jobs:
- name: Run Sanity tests
run: mvn clean test

- name: Slack Notification Demo
- name: Notify Slack on Test Failures
if: ${{ failure() }}
env:
GITHUB_ACTOR: ${GITHUB_ACTOR}
GITHUB_ACTION: ${GITHUB_ACTION}
GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}
GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}
GITHUB_WORKFLOW: ${GITHUB_WORKFLOW}
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Test failures detected in the workflow: '${{ github.workflow }}' of repository '${{ github.repository }}'."}' $SLACK_WEBHOOK_URL
WORKFLOW_NAME=$(echo "${{ github.workflow }}" | sed "s/'//g")
REPOSITORY_NAME=$(echo "${{ github.repository }}" | sed "s/'//g")
MESSAGE="Test failures detected in the workflow: '$WORKFLOW_NAME' of repository '$REPOSITORY_NAME'."
JSON="{\"text\":\"$MESSAGE\"}"
curl -X POST -H 'Content-type: application/json' --data "$JSON" "$SLACK_WEBHOOK_URL"
- name: Allure setup
Expand Down

0 comments on commit 620c5fc

Please sign in to comment.