-
Notifications
You must be signed in to change notification settings - Fork 836
61 lines (56 loc) · 1.48 KB
/
issue_on_error.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Issue On Error
# This workflow can be called from other workflows in order to generate
# an issue on failure.
#
# With only the required inputs issue will have the title of the failing workflow
# and a link to it.
#
# If the optional pr_number and link are provided the title and link will be for
# the PR.
#
# Either type of issue will be tagged (by default with ci:bot_issue).
# If an issue already exists, a comment will be added with a timestamp of the
# new failure and a link.
on:
workflow_call:
inputs:
repo:
type: string
required: true
workflow:
type: string
required: true
run_id:
type: string
required: true
run_number:
type: string
required: true
flag_label:
type: string
default: 'ci:bot_issue'
pr_number:
type: string
pr_link:
type: string
secrets:
token:
required: true
jobs:
error-trap:
runs-on: ubuntu-latest
name: Error Trap
steps:
- uses: actions/checkout@v3
- name: Run Reporting Script
env:
REPO: ${{ inputs.repo }}
WORKFLOW: ${{ inputs.workflow }}
RUN_ID: ${{ inputs.run_id }}
RUN_NUMBER: ${{ inputs.run_number }}
GITHUB_TOKEN: ${{ secrets.token }}
FLAG_LABEL: ${{ inputs.flag_label }}
PR_NUMBER: ${{ inputs.pr_number }}
PR_LINK: ${{ inputs.pr_link }}
run: |
python3 ci/issue_on_error.py