check-label-presence.py 714 B

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