-
-
Notifications
You must be signed in to change notification settings - Fork 2k
60 lines (55 loc) · 1.81 KB
/
Copy pathstubsabot.yml
File metadata and controls
60 lines (55 loc) · 1.81 KB
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: Run stubsabot daily
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
issues: write
pull-requests: write
env:
FORCE_COLOR: 1
jobs:
stubsabot:
name: Upgrade stubs with stubsabot
if: github.repository == 'python/typeshed'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# use an ssh key so that checks automatically run on stubsabot PRs
ssh-key: ${{ secrets.STUBSABOT_SSH_PRIVATE_KEY }}
fetch-depth: 0
- uses: astral-sh/setup-uv@v8.2.0
with:
version-file: "requirements-tests.txt"
- name: git config
run: |
git config --global user.name stubsabot
git config --global user.email '<>'
- name: Run stubsabot
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
uv run \
--python=3.13 \
--no-project \
--with-requirements=requirements-tests.txt \
scripts/stubsabot.py \
--action-level=everything
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
create-issue-on-failure:
name: Create issue on failure
runs-on: ubuntu-latest
needs: [stubsabot]
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}
steps:
- uses: actions/github-script@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.create({
owner: "python",
repo: "typeshed",
title: `Stubsabot failed on ${new Date().toDateString()}`,
body: "Stubsabot run is listed here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
})