fix: Excluding erroneous terraform version #56
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've been trying this tool out, and it's giving a funny response for the latest available Terraform version:
Did some digging and found that
20240919is the name of a branch on the hashicorp/terraform repo. Looks to me that theGitfunction in theversionspackage is pulling down a list of all refs from the repo, which includes branch names as well as tags. It then attempts to create a version number from each of those, skipping those that aren't parsable as version numbers. Problem with that approach is that a branch name can be anything, so if it's anything resembling a version number, it will be parsed as a version number.The
filterTerraformTagsfunction already filters out two branches which have been erroneously found as tags by this logic, so I'm adding this new branch to that list as a quick fix. I've built locally and run against the TF files in the example dir to check it's working, and it does. In the long run though, it would be better to rewrite theGitfunction to search for only tags , and not include all refs when looking at a GitHub repo. Given that this project seems to be abandoned and my PR is therefore unlikely to be merged, I'm not going to spend my time on that right now, and instead write my own tool for this. I'll just leave this here in case anyone hits the same problem.