File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 5
5
schedule :
6
6
- cron : " 0 0 * * *"
7
7
8
+ # Please keep the permissions minimal, as stubtest runs arbitrary code from pypi.
8
9
permissions :
9
10
contents : read
10
11
57
58
run : sudo apt install -y $(python tests/get_apt_packages.py)
58
59
- name : Run stubtest
59
60
run : python tests/stubtest_third_party.py --num-shards 4 --shard-index ${{ matrix.shard-index }}
61
+
62
+ # https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
63
+ create-issue-on-failure :
64
+ name : Create an issue if stubtest failed
65
+ runs-on : ubuntu-latest
66
+ needs : [stubtest-stdlib, stubtest-third-party]
67
+ if : ${{ github.repository == 'python/typeshed' && always() && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure') }}
68
+ permissions :
69
+ issues : write
70
+ steps :
71
+ - uses : actions/github-script@v3
72
+ with :
73
+ github-token : ${{secrets.GITHUB_TOKEN}}
74
+ script : |
75
+ await github.issues.create({
76
+ owner: "python",
77
+ repo: "typeshed",
78
+ title: `Stubtest failed on ${new Date().toDateString()}`,
79
+ body: "Stubtest runs are listed here: https://github.com/python/typeshed/actions/workflows/stubtest.yml",
80
+ })
You can’t perform that action at this time.
0 commit comments