Skip to content

Commit 9d89d73

Browse files
daneovpinkisemils
authored andcommitted
Send a Slack notification on a non-successful iOS E2E workflow
This commit introduces a notification on any case of a `completed` but unsuccessful workflow (i.e. where the conclusion is not `success`). **Rationale**: We currently send a notification if the E2E tests run and fail. Due to runner issues some scheduled nightly runs never get executed. As we only get notified of failing runs, we assume that "No news is good news", but that is not necessarily true. According to [this GitHub documentation][1] we should be able to monitor whether the iOS E2E test workflow is completed, which fits wanting to be informed about _both_ failed tests and scheduled runs, regardless of the reason. **How to test**: ~We should be able to execute the workflow using this PR/branch.~ According to the [documentation][2] this will only run on the `default` branch: > This event will only trigger a workflow run if the workflow file > exists on the default branch. **Technical details**: - [Workflow_run][3] has 3 `action types`: `requested`, `in_progress` and `completed`. - The `workflow_run` payload is documented [here][4]. **Note**: As I did not delete the original notification in `ios-end-to-end-tests-nightly.yml`, failed runs will notify us twice right now. I'd propose to remove that notification _after_ we've observed this notification to work consistently. **Caveat**: I did come across https://github.com/orgs/community/discussions/21090, but given the amount of time that has passed, I'm curious to see if that issue has been resolved in the meantime. [1]: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow [2]: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_run [3]: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_run [4]: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2026-03-10#get-a-workflow-run
1 parent 956a031 commit 9d89d73

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: iOS end-to-end nightly tests monitor
3+
on:
4+
# https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run
5+
workflow_run:
6+
workflows: ["iOS end-to-end nightly tests"]
7+
types:
8+
- completed
9+
10+
permissions: {}
11+
12+
jobs:
13+
notify-on-failed-workflow:
14+
# Payload of workflow_run:
15+
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2026-03-10#get-a-workflow-run
16+
if: "${{ github.event.workflow_run.conclusion != 'successful' }}"
17+
name: Notify team on nightly E2E failure
18+
runs-on: [ubuntu-latest]
19+
timeout-minutes: 5
20+
steps:
21+
- name: Send custom event details to a Slack workflow
22+
uses: slackapi/slack-github-action@v2.1.1
23+
with:
24+
webhook: ${{ secrets.IOS_SLACK_WEBHOOK_URL }}
25+
webhook-type: webhook-trigger
26+
# workflow_run.html_url returns the full url of the workflow we're responding too.
27+
payload: |
28+
run_url: "${{ github.event.workflow_run.html_url }}"

0 commit comments

Comments
 (0)