Skip to content

Commit

Permalink
fixed python script
Browse files Browse the repository at this point in the history
  • Loading branch information
bartkrak committed May 16, 2024
1 parent a723339 commit aa1a5e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .github/actions/add_pr_to_smackore_board/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ runs:
run: |
# currently this may cause github action crash, more info here: https://github.com/membraneframework/membrane_core/issues/749
# this debug varible is set only for troubleshooting, remove this later
export GH_DEBUG=api
export PROJECT_NUMBER=19
export PROJECT_ID=PVT_kwDOAYE_z84AWEIB
export STATUS_FIELD_ID=PVTSSF_lADOAYE_z84AWEIBzgOGd1k
Expand Down
5 changes: 2 additions & 3 deletions scripts/python/get_author_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@

print("COMMUNITY")
except:
print("An exception occurred, provided JSON:")
print(membrane_team)
print("provided PR_AUTHOR:", pr_author)
print("An exception occurred in get_author_origin.py, provided JSON: ", membrane_team)
print("Provided PR_AUTHOR: ", pr_author)
23 changes: 15 additions & 8 deletions scripts/python/get_ticket_id.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import sys, json;

full_json = json.load(sys.stdin)

pr_url = sys.argv[1]

try:
project_items = full_json["items"]
[id] = [item["id"] for item in project_items if ("url" in item["content"] and item["content"]["url"] == pr_url)]
print(id)
except:
print("An exception occurred, provided JSON:")
print(full_json)
print("provided PR_URL:", pr_url)
project_items = full_json["items"]

item_id = None
for item in project_items:
if "content" in item and "url" in item["content"]:
if item["content"]["url"] == pr_url:
item_id = item["id"]
break

if item_id == None:
print("Error occurred in get_ticket.py: item_id == None, provided JSON[project_items]: ", project_items)
sys.exit(1)
else:
print(item_id)

0 comments on commit aa1a5e7

Please sign in to comment.