summaryrefslogtreecommitdiff
path: root/ci/trigger_build_kits.py
blob: 0485df10a3c78d83c342075d01776a7e99ad4a5d (plain)
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
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt

"""Trigger the GitHub action to build our kits."""

import sys

import requests

repo_owner = sys.argv[1]

# The GitHub URL makes no mention of which workflow to use. It's found based on
# the event_type, which matches the types in the workflow:
#
#   on:
#     repository_dispatch:
#       types:
#         - build-kits
#

resp = requests.post(
    f"https://api.github.com/repos/{repo_owner}/dispatches",
    json={"event_type": "build-kits"},
)
print(f"Status: {resp.status_code}")
print(resp.text)