Skip to content

Commit 3967e28

Browse files
Add a new file for all AMI (#1863)
* Add a new file for all AMI
1 parent b24eac9 commit 3967e28

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/actions/build_ami/action.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)