mirror of
https://github.com/ong19th/Citron.git
synced 2025-12-12 16:36:55 +00:00
CI: Update CI workflows to use Citron-specific naming and paths
This commit is contained in:
parent
257aad2431
commit
eec0f34204
65 changed files with 2596 additions and 10 deletions
27
.ci/scripts/merge/check-label-presence.py
Executable file
27
.ci/scripts/merge/check-label-presence.py
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
# SPDX-FileCopyrightText: 2019 citron Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Check if a pull request has a specific label
|
||||
# Usage: python3 check-label-presence.py <PR Number> <Label Text>
|
||||
|
||||
import json, sys
|
||||
from urllib import request
|
||||
import os
|
||||
|
||||
url = 'https://api.github.com/repos/Citron-Project/Cit/issues/%s' % sys.argv[1]
|
||||
headers = {'Accept': 'application/vnd.github.v3+json'}
|
||||
token = os.environ.get('EARLY_ACCESS_TOKEN')
|
||||
if token:
|
||||
headers['Authorization'] = f'token {token}'
|
||||
req = request.Request(url, headers=headers)
|
||||
try:
|
||||
response = request.urlopen(req)
|
||||
j = json.loads(response.read().decode('utf-8'))
|
||||
for label in j['labels']:
|
||||
if label['name'] == sys.argv[2]:
|
||||
print('true')
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f'Error: {e}')
|
||||
print('false')
|
||||
sys.exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue