CDPHE-bioinformatics/CDPHE-SARS-CoV-2

[REQUEST] Auto version workflow using GitHub Action

Closed this issue · 4 comments

Feature Request

It is troublesome and error prone to manually update the workflow version.

Solution

Use a GitHub Action to automatically update the version (including the git tag) when a pull request is merged into main.

Upstream effects

None.

Downstream effects

None.

We should consider using decimals instead of dashes for SemVer compatibility.

Workflow_Version="v2-3-1"

We have discussed using "v" but we might want to revisit this. Originally we said that with or without "v" is less important a decision than just being consistent.

After looking at more tutorials about Python, it seems better to leave the "v" off and add it where needed / prior to exporting. But more opinions required.

Perhaps we remove the timezone input since the default for a container such as ubuntu:focal is UTC, which is what we assume for all of our Cloud processes as well.

Instead of echoing the workflow version, we can directly input it into the output. I'm not sure of the benefit of echoing it, so I'm not changing this for now.

command <<<
Workflow_Version="v2-3-1"
~{default='' 'export TZ=' + timezone}
date +"%Y-%m-%d" > TODAY
echo "$Workflow_Version" > WORKFLOW_VERSION
>>>
output {
String analysis_date = read_string("TODAY")
String workflow_version = read_string("WORKFLOW_VERSION")
}

As an example, instead we would remove the echo statement and the output would have:

String workflow_version = "2.3.1"

This is ready for review and merge to develop. Since this doesn't add functionality to the WDL itself or the pipeline, I'd consider this a #patch.