Skip to content

Commit bf58aec

Browse files
Require BLACKSMITH_AGENT_ADDR for metadata service discovery
Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
1 parent 233448a commit bf58aec

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎.github/workflows/test.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,14 @@ jobs:
1717

1818
- name: Lint action.yml
1919
run: yamllint -d relaxed action.yml
20+
21+
smoke:
22+
runs-on: blacksmith
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Assert BLACKSMITH_AGENT_ADDR is advertised
27+
run: test -n "$BLACKSMITH_AGENT_ADDR"
28+
29+
- name: Run begin-testbox in validation mode
30+
uses: ./

‎action.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ runs:
3434
fi
3535
export METADATA_PORT
3636
fi
37+
if [ -z "$BLACKSMITH_AGENT_ADDR" ]; then
38+
echo "::warning::BLACKSMITH_AGENT_ADDR is not set; testbox is only supported on Blacksmith runners. Skipping testbox setup."
39+
echo "available=false" >> "$GITHUB_OUTPUT"
40+
exit 0
41+
fi
3742
echo "available=true" >> "$GITHUB_OUTPUT"
38-
echo "metadata_addr=192.168.127.1:${METADATA_PORT}" >> "$GITHUB_OUTPUT"
43+
echo "metadata_addr=${BLACKSMITH_AGENT_ADDR}:${METADATA_PORT}" >> "$GITHUB_OUTPUT"
3944
4045
- name: Phone home and configure testbox
4146
if: steps.metadata.outputs.available == 'true' && inputs.testbox_id

0 commit comments

Comments
 (0)