This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
IF YOU WANT TO UPLOAD ONE FILE, USE THE CODE BELOW. | |
SEE THE BOTTOM OF THE GIST TO SEE HOW TO UPLOAD MULTIPLE FILES. | |
HERE'S AN EXAMPLE SOMEONE MADE USING CLOUDINARY: https://gist.github.com/jamielob/5c1a5dc84e50e4507b71299d993dffec | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
user="user" | |
repo="repo" | |
token="token" | |
url = f"https://api.github.com/repos/{user}/{repo}/dispatches" | |
payload = {"event_type": "awesomeness", "client_payload": {"foo": "bar"}} | |
header = {"Accept": "application/vnd.github.everest-preview+json", "Authorization": f"token {token}"} | |
resp = requests.post(url=url, headers=header, json=payload) |