Skip to content

Commit a6446d0

Browse files
committed
add capture for template id, build id
1 parent af0c3c0 commit a6446d0

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/build_test_template.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
template_id:
1414
description: "The ID of the built template"
1515
value: ${{ jobs.build.outputs.template_id }}
16+
build_id:
17+
description: "The ID of the build"
18+
value: ${{ jobs.build.outputs.build_id }}
1619

1720
permissions:
1821
contents: read
@@ -23,6 +26,7 @@ jobs:
2326
runs-on: ubuntu-latest
2427
outputs:
2528
template_id: ${{ steps.build-template.outputs.template_id }}
29+
build_id: ${{ steps.build-template.outputs.build_id }}
2630
steps:
2731
- name: Checkout repository
2832
uses: actions/checkout@v4
@@ -46,18 +50,18 @@ jobs:
4650
id: build-template
4751
working-directory: ./template
4852
run: |
49-
python build_ci.py
50-
# BUILD_OUTPUT=$(python build_ci.py 2>&1)
51-
# echo "$BUILD_OUTPUT"
52-
# TEMPLATE_ID=$(echo "$BUILD_OUTPUT" | grep "Template created with ID:" | sed 's/.*Template created with ID: \([^,]*\).*/\1/')
53-
# BUILD_ID=$(echo "$BUILD_OUTPUT" | grep -A 1 "Build ID:" | tail -n 1 | xargs)
54-
# echo "Captured Template ID: $TEMPLATE_ID"
55-
# echo "Captured Build ID: $BUILD_ID"
56-
# echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
53+
python build_ci.py 2>&1 | tee build_output.log
54+
TEMPLATE_ID=$(grep "Template created with ID:" build_output.log | sed 's/.*Template created with ID: \([^,]*\).*/\1/')
55+
BUILD_ID=$(grep -A 1 "Build ID:" build_output.log | tail -n 1 | xargs)
56+
echo "Captured Template ID: $TEMPLATE_ID"
57+
echo "Captured Build ID: $BUILD_ID"
58+
echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
59+
echo "build_id=$BUILD_ID" >> $GITHUB_OUTPUT
5760
env:
5861
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
5962
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
6063

61-
- name: Output template ID
64+
- name: Output template and build IDs
6265
run: |
6366
echo "Template ID from step output: ${{ steps.build-template.outputs.template_id }}"
67+
echo "Build ID from step output: ${{ steps.build-template.outputs.build_id }}"

0 commit comments

Comments
 (0)