Skip to content

Commit

Permalink
Fix regex and glob for build manifests on copy step (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
guicaulada authored Nov 8, 2024
1 parent e31ea85 commit f8e97cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/packer-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}" \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f8e97cf

Please sign in to comment.