1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 19:55:46 +00:00
Files
fep/scripts/pull_request.py
T
helge 16acf44939 Automate things (#117)
This pull requests contains the basic automation scripts as described in `ISSUE_TEMPLATES/README.md`.

Feps needed to be changed to continue links to their tracking issues.

- [x] Description of how to best merge a pull request still missing
- [x] Rename folder ISSUE_TEMPLATES to something better.

Co-authored-by: Helge <helge.krueger@gmail.com>
Reviewed-on: https://codeberg.org/fediverse/fep/pulls/117
2023-07-16 07:43:02 +00:00

28 lines
685 B
Python

from argparse import ArgumentParser
from datetime import date, timedelta
from tools import FepFile
import json
import requests
parser = ArgumentParser("Pullrequest")
parser.add_argument("pr", help="Pull request id")
args = parser.parse_args()
with open("ISSUE_TEMPLATE/config.json") as f:
config = json.load(f)
print(
f"https://codeberg.org/api/v1/repos/{config['owner']}/{config['repo']}/pulls/{args.pr}"
)
response = requests.get(
f"https://codeberg.org/api/v1/repos/{config['owner']}/{config['repo']}/pulls/{args.pr}",
headers={"authorization": f"Bearer {config['token']}"},
)
print(response)
print(response.text)
print(json.dumps(response.json(), indent=2))