Skip to content

Commit ca43c00

Browse files
committed
Notify on workflow failure
Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent 36dbf85 commit ca43c00

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/create-issue-on-failure.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: "Test build against Timely master"
3+
about: "Create an issue when the build against Timely master fails"
4+
title: 'Workflow "{{ env.WORKFLOW_NAME }}" failed'
5+
labels: "build-failure"
6+
---
7+
8+
The workflow "**{{ env.WORKFLOW_NAME }}**" failed. See logs:
9+
https://github.com/{{ env.REPO_SLUG }}/actions/runs/{{ env.RUN_ID }}
10+
11+
Commit: https://github.com/{{ env.REPO_SLUG }}/commit/{{ tools.context.sha }}
12+
13+
// cc: {{ env.MENTION }} — please triage and resolve this issue

.github/workflows/test-timely-master.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ on:
55
- master
66
pull_request:
77
workflow_dispatch:
8+
schedule:
9+
- cron: '38 3 * * *'
810

911
jobs:
10-
test:
12+
tests:
1113
strategy:
1214
matrix:
1315
os:
@@ -23,3 +25,24 @@ jobs:
2325
toolchain: ${{ matrix.toolchain }}
2426
- name: Cargo test against Timely master
2527
run: cd timely_master && cargo test
28+
29+
notify:
30+
name: Notify failed build
31+
if: failure() && github.event.pull_request == null
32+
needs: [tests]
33+
permissions:
34+
contents: read
35+
issues: write
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: JasonEtco/create-an-issue@v2
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
WORKFLOW_NAME: ${{ github.workflow }}
42+
REPO_SLUG: ${{ github.repository }}
43+
RUN_ID: ${{ github.run_id }}
44+
MENTION: '@frankmcsherry, @antiguru'
45+
with:
46+
filename: '.github/create-issue-on-failure.md'
47+
update_existing: true
48+
search_existing: open

0 commit comments

Comments
 (0)