create gh actions using reusable actions #19
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I closed PR 18 by addressing the changes requested. In addition, I made more changes as I realized creating a class would help us reuse the code for addressing the next task in ImagingDataCommons/idc-index-data#2. I wanted to move away from gh api as much as possible as it may not be reusable for future tasks. Instead, I tried to use available gh actions to do the heavy lifting.
This workflow will address task 1 of ImagingDataCommons/idc-index-data#2
It will get the current version of IDC referenced in the index and check if it is outdated wrt to the IDC release referenced by the bigquery-public-data.idc_current.dicom_all view in bigquery. If it is outdated, it will update the version in each of the queries in the queries/ folder of the repo, run them using bigquery, and generate a {query_file_prefix}.csv.zip for each query. It will also update the version in index.py.
It then creates a new release with the 'latest' tag, and uploads the csv.zip files as a release attachment.
Lastly, it will create a pull request to update the SQL queries in the queries/ folder and the index.py
Note: We must create two GitHub secrets called SERVICE_ACCOUNT_KEY and GCP_PROJECT_ID