Use GITHUB_REF_NAME to determine current tag for release workflow
#879
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.
(Hopefully) closes #878.
We'll now use the GitHub-provided environment variable
GITHUB_REF_NAMEto determine the current (most recent) tag, rather than the unreliable sort. According to the docs, this value will be:I was able to test this locally with act (thanks Bolaji!!) using simulated tag push events. I tested that a new tag triggered the "new latest" version of the workflow and that an older patch version tag triggered the patch version. As a caveat, since I could only test with a simulated event, we of course can't guarantee that a real GitHub event wouldn't behave differently. But I have higher confidence, at least.
I also tried to clarify a couple comments, mostly because after staring at the words "latest" and "current" and "most recent" for a couple days, they all started to blur together in my mind. 🤪
Test plan
I'll take point on our 4.2 release (or any sooner patch, if it comes up) later this month to verify the workflow succeeds.