From a442e2eebfc612bc958114abefef3579d5abbc74 Mon Sep 17 00:00:00 2001 From: npetrill Date: Thu, 12 Dec 2024 13:36:04 -0500 Subject: [PATCH] try to hit dockstore --- .../workflows/test_illumina_genotyping_array.yml | 1 + scripts/dockstore_api/fetch_dockstore_id.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_illumina_genotyping_array.yml b/.github/workflows/test_illumina_genotyping_array.yml index 507b42507d..5ad88af626 100644 --- a/.github/workflows/test_illumina_genotyping_array.yml +++ b/.github/workflows/test_illumina_genotyping_array.yml @@ -97,6 +97,7 @@ jobs: run: | python scripts/dockstore_api/fetch_dockstore_id.py $DOCKSTORE_TOKEN github.com%2Fbroadinstitute%2Fwarp%2FIlluminaGenotypingArray BIOWORKFLOW np_jw_test_illumina_genotyping_arrays env: + ##TODO NEED TO ADD DOCKSTORE_TOKEN FOR SERVICE ACCOUNT## DOCKSTORE_TOKEN: ${{ secrets.DOCKSTORE_TOKEN }} - name: Set Commit Hash diff --git a/scripts/dockstore_api/fetch_dockstore_id.py b/scripts/dockstore_api/fetch_dockstore_id.py index cfc3048dcf..d6064ebecc 100644 --- a/scripts/dockstore_api/fetch_dockstore_id.py +++ b/scripts/dockstore_api/fetch_dockstore_id.py @@ -15,8 +15,19 @@ def fetch_workflow_id(token, repository, subclass, version_name): response = requests.get(url, params=params, headers=headers) response.raise_for_status() - workflow_data = response.json() - print(workflow_data.get("id")) + data = response.json() + + # Extract workflow and version IDs + workflow_id = data.get("id") + version_id = next( + (version["id"] for version in data.get("workflowVersions", []) + if version["name"] == {version_name}), + None + ) + + print(f"Workflow ID: {workflow_id}") + print(f"Version ID: {version_id}") + if __name__ == "__main__": if len(sys.argv) != 5: