opensafely-actions / cohort-report

Cohort-report generates a report for each variable in an input file
MIT License
0 stars 0 forks source link

Replace bump script with bump version workflow #60

Closed iaindillingham closed 2 years ago

iaindillingham commented 2 years ago

This replaces a bump script, which calls bump2version, with a bump version workflow that is triggered by a conventional commit message. The workflow makes releasing far less error-prone and ensures that releases, and their corresponding changes, are much closer in the Git log.

You'll notice that the workflow is slightly different to other OpenSAFELY workflows that use github-tag-action. This is because a new version is not only used to tag a commit; it is also used to bump instances of the old version within the repository. Why?

In the case of cohortreport/VERSION, this is because we don't want to shell-out to Git to make the version available to the client. (You may ask why we want to make the version available to the client; I'm afraid I don't know the answer.)

More importantly, in the case of README.md, this is because we display this file in https://actions.opensafely.org/. Users copy-and-paste the project.yaml extract into their own studies; we want them to paste the latest version. However, to encourage reproducibility, don't want to tag a latest version. #45 is an example of when a hard-coded -- and, as it happens, incorrect -- version has tripped up a researcher.