mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Automatically create an issue if the nightly stubtest run fails (#6978)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
21
.github/workflows/stubtest.yml
vendored
21
.github/workflows/stubtest.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
# Please keep the permissions minimal, as stubtest runs arbitrary code from pypi.
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -57,3 +58,23 @@ jobs:
|
||||
run: sudo apt install -y $(python tests/get_apt_packages.py)
|
||||
- name: Run stubtest
|
||||
run: python tests/stubtest_third_party.py --num-shards 4 --shard-index ${{ matrix.shard-index }}
|
||||
|
||||
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
|
||||
create-issue-on-failure:
|
||||
name: Create an issue if stubtest failed
|
||||
runs-on: ubuntu-latest
|
||||
needs: [stubtest-stdlib, stubtest-third-party]
|
||||
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure') }}
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
await github.issues.create({
|
||||
owner: "python",
|
||||
repo: "typeshed",
|
||||
title: `Stubtest failed on ${new Date().toDateString()}`,
|
||||
body: "Stubtest runs are listed here: https://github.com/python/typeshed/actions/workflows/stubtest.yml",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user