diff --git a/.gitea/workflows/auto-pr-tofu-plan.yml b/.gitea/workflows/auto-pr-tofu-plan.yml index 8166016..3f82f1c 100644 --- a/.gitea/workflows/auto-pr-tofu-plan.yml +++ b/.gitea/workflows/auto-pr-tofu-plan.yml @@ -72,29 +72,17 @@ jobs: TEA_DL_URL: "https://dl.gitea.com/tea/${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64" shell: bash run: | - set -euo pipefail - cd /tmp - - wget -q "${TEA_DL_URL}" - wget -q "${TEA_DL_URL}.sha256" - - # Read only the hash (strip whitespace) - sha_value=$(cat "tea-${TEA_VERSION}-linux-amd64.sha256" | tr -d '[:space:]') - - # Verify using sha256sum - echo "${sha_value} tea-${TEA_VERSION}-linux-amd64" | sha256sum -c - - - mv "tea-${TEA_VERSION}-linux-amd64" /usr/bin/tea - chmod +x /usr/bin/tea - - pr_number=$(tea pr ls --repo "${{ gitea.repository }}" \ - --state open \ - --fields index,state,head \ - --output simple \ - | awk '{print $1}') - - echo "${pr_number}" - echo "pr_number=${pr_number}" >> "$GITHUB_OUTPUT" + cd /tmp + echo ${TEA_DL_URL} + wget -q "${TEA_DL_URL}" + wget -q "${TEA_DL_URL}.sha256" + if $(sha256sum --quiet -c "tea-${{ env.TEA_VERSION }}-linux-amd64.sha256"); then + mv "tea-${{ env.TEA_VERSION }}-linux-amd64" /usr/bin/tea + chmod +x /usr/bin/tea + else + echo "WARNING ⛔: Tea v${{ env.TEA_VERSION }} Checksum Failed" + exit 1 + fi - name: Generate .env from Hashicorp Vault