From f8e97cfe8e9d99340eb966f1e50ea733cfc7674b Mon Sep 17 00:00:00 2001 From: Guilherme Caulada Date: Fri, 8 Nov 2024 14:08:49 -0300 Subject: [PATCH] Fix regex and glob for build manifests on copy step (#132) --- .github/workflows/packer-build-and-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/packer-build-and-publish.yml b/.github/workflows/packer-build-and-publish.yml index ca7f17cd2956..0dbe8cce231b 100644 --- a/.github/workflows/packer-build-and-publish.yml +++ b/.github/workflows/packer-build-and-publish.yml @@ -295,7 +295,7 @@ jobs: "${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ needs.publish.outputs.release_id }}/assets") # Filter assets matching the pattern and download each one - echo "$assets" | jq -r '.[] | select(.name | test("^build-manifest-.*\\.json$")) | "\(.id) \(.name)"' | while read -r asset_id asset_name; do + echo "$assets" | jq -r '.[] | select(.name | test(".*build-manifest\\.json$")) | "\(.id) \(.name)"' | while read -r asset_id asset_name; do echo "Downloading $asset_name (ID: $asset_id)" curl -L -H "Accept: application/octet-stream" \ -H "Authorization: token ${{ github.token }}" \ @@ -313,7 +313,7 @@ jobs: - name: Share AMIs with Prod Account run: | PROD_ACCOUNT_ID="${{ env.PROD_ACCOUNT }}" - for file in build-manifest-*.json; do + for file in *build-manifest.json; do echo "Processing $file for sharing" builds_length=$(jq '.builds | length' "$file") for ((i=0; i<$builds_length; i++)); do @@ -346,7 +346,7 @@ jobs: - name: Copy AMIs to Prod Account run: | - for file in build-manifest-*.json; do + for file in *build-manifest.json; do echo "Processing $file for copying" builds_length=$(jq '.builds | length' "$file") for ((i=0; i<$builds_length; i++)); do