check-label-presence.py 624 B

123456789101112131415161718
  1. # Checks to see if the specified pull request # has the specified tag
  2. # Usage: python check-label-presence.py <Pull Request ID> <Name of Label>
  3. import requests, json, sys
  4. try:
  5. url = 'https://api.github.com/repos/yuzu-emu/yuzu/issues/%s' % sys.argv[1]
  6. response = requests.get(url)
  7. if (response.ok):
  8. j = json.loads(response.content)
  9. for label in j["labels"]:
  10. if label["name"] == sys.argv[2]:
  11. print('##vso[task.setvariable variable=enabletesting;]true')
  12. sys.exit()
  13. except:
  14. sys.exit(-1)
  15. print('##vso[task.setvariable variable=enabletesting;]false')