From 6e0dff335b1fdec00a1e30093ae3491415f21cf0 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 3 Dec 2024 11:01:11 -0500 Subject: [PATCH] .github/workflows: fix registry version check comparison (#40406) The version returned from the `curl` request to the registry will contain only the version number, while the release tag is prefixed with `v`. For example, here is what is stored in the `LATEST_VERSION` environment variable: ```console % curl -s "https://registry.terraform.io/v2/providers/323/provider-versions/latest" | jq -r '.data.attributes.version' 5.79.0 ``` This changes the conditional to apply a prefix to the version number fetched from the registry to allow an accurate comparison of the two values. --- .github/workflows/post_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post_publish.yml b/.github/workflows/post_publish.yml index 84ada517445..08125f5f198 100644 --- a/.github/workflows/post_publish.yml +++ b/.github/workflows/post_publish.yml @@ -65,7 +65,7 @@ jobs: for i in 1 2 do LATEST_VERSION=$(curl -s "https://registry.terraform.io/v2/providers/323/provider-versions/latest" | jq -r '.data.attributes.version') - if [[ "${{ needs.on-success-or-workflow-dispatch.outputs.release-tag }}" != ${LATEST_VERSION} ]]; then + if [[ "${{ needs.on-success-or-workflow-dispatch.outputs.release-tag }}" != "v${LATEST_VERSION}" ]]; then sleep 1h else echo "Registry and Github Version matches"