Skip to content

Commit dd86951

Browse files
committed
ci: send a slack notification once unit-test action on github runs successfully
1 parent 3051324 commit dd86951

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/android.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,17 @@ jobs:
9696
with:
9797
api-level: 29
9898
script: ./gradlew connectedCheck
99+
100+
notify-slack:
101+
needs: unit-test
102+
runs-on: ubuntu-latest
103+
if: always() # Runs regardless of success or failure of unit-test
104+
steps:
105+
- name: Send Slack notification
106+
env:
107+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GITHUB_BUILD_INFO }}
108+
run: |
109+
STATUS="${{ needs.unit-test.result }}"
110+
curl -X POST -H 'Content-type: application/json' \
111+
--data "{\"text\":\"Unit tests completed: $STATUS\"}" \
112+
$SLACK_WEBHOOK_URL

0 commit comments

Comments
 (0)