Skip to content

Commit aa1a5e7

Browse files
committed
fixed python script
1 parent a723339 commit aa1a5e7

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.github/actions/add_pr_to_smackore_board/action.yml

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ runs:
2121
run: |
2222
# currently this may cause github action crash, more info here: https://github.com/membraneframework/membrane_core/issues/749
2323
24-
# this debug varible is set only for troubleshooting, remove this later
25-
export GH_DEBUG=api
26-
2724
export PROJECT_NUMBER=19
2825
export PROJECT_ID=PVT_kwDOAYE_z84AWEIB
2926
export STATUS_FIELD_ID=PVTSSF_lADOAYE_z84AWEIBzgOGd1k

scripts/python/get_author_origin.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515

1616
print("COMMUNITY")
1717
except:
18-
print("An exception occurred, provided JSON:")
19-
print(membrane_team)
20-
print("provided PR_AUTHOR:", pr_author)
18+
print("An exception occurred in get_author_origin.py, provided JSON: ", membrane_team)
19+
print("Provided PR_AUTHOR: ", pr_author)

scripts/python/get_ticket_id.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import sys, json;
22

33
full_json = json.load(sys.stdin)
4+
45
pr_url = sys.argv[1]
56

6-
try:
7-
project_items = full_json["items"]
8-
[id] = [item["id"] for item in project_items if ("url" in item["content"] and item["content"]["url"] == pr_url)]
9-
print(id)
10-
except:
11-
print("An exception occurred, provided JSON:")
12-
print(full_json)
13-
print("provided PR_URL:", pr_url)
7+
project_items = full_json["items"]
8+
9+
item_id = None
10+
for item in project_items:
11+
if "content" in item and "url" in item["content"]:
12+
if item["content"]["url"] == pr_url:
13+
item_id = item["id"]
14+
break
15+
16+
if item_id == None:
17+
print("Error occurred in get_ticket.py: item_id == None, provided JSON[project_items]: ", project_items)
18+
sys.exit(1)
19+
else:
20+
print(item_id)

0 commit comments

Comments
 (0)