From 198ec4fc1469bc7369119dcbab09ea4f82ea3220 Mon Sep 17 00:00:00 2001 From: jaskaransarkaria Date: Thu, 21 Nov 2024 14:43:05 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rsion.yml => push-terraform-module-version.yaml} | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) rename .github/workflows/{push-terraform-module-version.yml => push-terraform-module-version.yaml} (54%) diff --git a/.github/workflows/push-terraform-module-version.yml b/.github/workflows/push-terraform-module-version.yaml similarity index 54% rename from .github/workflows/push-terraform-module-version.yml rename to .github/workflows/push-terraform-module-version.yaml index 389c2d3..cd42bbb 100644 --- a/.github/workflows/push-terraform-module-version.yml +++ b/.github/workflows/push-terraform-module-version.yaml @@ -8,12 +8,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Export LATEST_TAG + run: | + echo "LATEST_TAG=$(curl \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "${{ github.api_url }}/repos/${{ github.repository }}/releases/latest" \ + | jq -r .tag_name)" >> $GITHUB_ENV + - uses: ministryofjustice/cloud-platform-environments/cmd/push-terraform-module-version@main + name: push version to go-get-module api + if: ${{ github.ref_name == env.LATEST_TAG }} env: - # see https://github.com/ministryofjustice/cloud-platform-go-get-module/ - # get the address from the ingress eg. 'https://' + `kubectl get ing -n cloud-platform-go-get-module-$ENV` API_URL: ${{ vars.TERRAFORM_MODULE_VERSIONS_API_URL }} - # get this via the cli eg. `cloud-platform decode-secret -n cloud-platform-go-get-module-prod -s go-get-module-api-key` API_KEY: ${{ secrets.TERRAFORM_MODULE_VERSIONS_API_KEY }} REPO_NAME: ${{ github.event.repository.name }} UPDATED_MODULE_VERSION: ${{ github.ref_name }}