File tree Expand file tree Collapse file tree
.github/actions/build_ami Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,6 +164,30 @@ runs:
164164 echo "uid2_AMI_measurement.txt Contents:"
165165 cat uid2_AMI_measurement.txt
166166 ls -al
167+
168+ # Persist to aws-ami-poc.json
169+ AMI_ID="${{ steps.extractAmiIdAndEnclaveId.outputs.AMI_ID }}"
170+ REGION="us-east-1"
171+ FILE="aws-ami-poc.json"
172+
173+ # Initialize the file if it doesn't exist
174+ if [ ! -f "$FILE" ]; then
175+ echo "{}" > "$FILE"
176+ fi
177+
178+ # Update JSON using jq
179+ jq --arg region "$REGION" --arg ami "$AMI_ID" \
180+ ' .[$region] += [$ami] | .[$region] |= unique' " $FILE" > tmp.$FILE && mv tmp.$FILE "$FILE"
181+
182+ echo "Updated $FILE:"
183+ cat "$FILE"
184+
185+ - name : Commit aws-ami-poc.json update
186+ if : ${{ steps.checkRelease.outputs.is_release != 'true' }}
187+ uses : IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2
188+ with :
189+ add : ' ./scripts/aws/uid2-operator-ami/aws-ami-poc.json'
190+ message : ' Updated AMI ID for UID2 in aws-ami-poc.json'
167191
168192 - name : Copy AMI to us-east-1
169193 id : euidCopyAmi
You can’t perform that action at this time.
0 commit comments