All of the webhooks the website uses for updates
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

28 行
553 B

  1. #! /usr/bin/python3
  2. import sys
  3. import os
  4. import requests
  5. import json
  6. TOKEN = os.environ["GITEA_API_KEY"]
  7. url = "https://git.crux.best/api/v1/repos/chemicalcrux/{0}/releases".format(sys.argv[1])
  8. r = requests.get(url, headers = {
  9. "authorization": "token " + TOKEN
  10. })
  11. if r.status_code != 200:
  12. print("oops...")
  13. sys.exit(1)
  14. data = json.loads(r.text)
  15. result = {}
  16. for release in data:
  17. result[release["name"]] = release["body"]
  18. with open(os.path.join(sys.argv[2], "changelog.json"), "w", encoding="utf-8") as file:
  19. json.dump(result, file)