From bf58aecef2305e364edd529cf6a792bb3d3de688 Mon Sep 17 00:00:00 2001 From: piob-io Date: Wed, 29 Jul 2026 16:36:03 +0000 Subject: [PATCH 1/3] Require BLACKSMITH_AGENT_ADDR for metadata service discovery Co-authored-by: Codesmith Staging --- .github/workflows/test.yml | 11 +++++++++++ action.yml | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53d76c2..29ffffc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,3 +17,14 @@ jobs: - name: Lint action.yml run: yamllint -d relaxed action.yml + + smoke: + runs-on: blacksmith + steps: + - uses: actions/checkout@v4 + + - name: Assert BLACKSMITH_AGENT_ADDR is advertised + run: test -n "$BLACKSMITH_AGENT_ADDR" + + - name: Run begin-testbox in validation mode + uses: ./ diff --git a/action.yml b/action.yml index 5f18615..2634f0a 100644 --- a/action.yml +++ b/action.yml @@ -34,8 +34,13 @@ runs: fi export METADATA_PORT fi + if [ -z "$BLACKSMITH_AGENT_ADDR" ]; then + echo "::warning::BLACKSMITH_AGENT_ADDR is not set; testbox is only supported on Blacksmith runners. Skipping testbox setup." + echo "available=false" >> "$GITHUB_OUTPUT" + exit 0 + fi echo "available=true" >> "$GITHUB_OUTPUT" - echo "metadata_addr=192.168.127.1:${METADATA_PORT}" >> "$GITHUB_OUTPUT" + echo "metadata_addr=${BLACKSMITH_AGENT_ADDR}:${METADATA_PORT}" >> "$GITHUB_OUTPUT" - name: Phone home and configure testbox if: steps.metadata.outputs.available == 'true' && inputs.testbox_id From 8c78e269a9e6cd5e1895270ad1d7bb653f6c262f Mon Sep 17 00:00:00 2001 From: piob-io Date: Wed, 29 Jul 2026 22:01:12 +0000 Subject: [PATCH 2/3] Check BLACKSMITH_AGENT_ADDR before metadata_port discovery Co-authored-by: Codesmith Staging --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 2634f0a..4c6f1bb 100644 --- a/action.yml +++ b/action.yml @@ -24,9 +24,14 @@ runs: id: metadata shell: bash run: | + if [ -z "${BLACKSMITH_AGENT_ADDR:-}" ]; then + echo "::warning::BLACKSMITH_AGENT_ADDR is not set; testbox is only supported on Blacksmith runners. Skipping testbox setup." + echo "available=false" >> "$GITHUB_OUTPUT" + exit 0 + fi METADATA_PORT="${METADATA_PORT:-}" if [ -z "$METADATA_PORT" ]; then - METADATA_PORT=$(cat /proc/cmdline | tr ' ' '\n' | grep '^metadata_port=' | cut -d'=' -f2) + METADATA_PORT=$(tr ' ' '\n' < /proc/cmdline | grep '^metadata_port=' | cut -d'=' -f2 || true) if [ -z "$METADATA_PORT" ]; then echo "metadata_port not found in kernel cmdline" echo "available=false" >> "$GITHUB_OUTPUT" @@ -34,11 +39,6 @@ runs: fi export METADATA_PORT fi - if [ -z "$BLACKSMITH_AGENT_ADDR" ]; then - echo "::warning::BLACKSMITH_AGENT_ADDR is not set; testbox is only supported on Blacksmith runners. Skipping testbox setup." - echo "available=false" >> "$GITHUB_OUTPUT" - exit 0 - fi echo "available=true" >> "$GITHUB_OUTPUT" echo "metadata_addr=${BLACKSMITH_AGENT_ADDR}:${METADATA_PORT}" >> "$GITHUB_OUTPUT" From 784f8577fd1c8d7e5a2d7058ab6ae4997fe762ea Mon Sep 17 00:00:00 2001 From: piob-io Date: Wed, 29 Jul 2026 22:06:54 +0000 Subject: [PATCH 3/3] Warn when metadata_port is missing from kernel cmdline Co-authored-by: Codesmith Staging --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4c6f1bb..cf64a84 100644 --- a/action.yml +++ b/action.yml @@ -33,7 +33,7 @@ runs: if [ -z "$METADATA_PORT" ]; then METADATA_PORT=$(tr ' ' '\n' < /proc/cmdline | grep '^metadata_port=' | cut -d'=' -f2 || true) if [ -z "$METADATA_PORT" ]; then - echo "metadata_port not found in kernel cmdline" + echo "::warning::metadata_port not found in kernel cmdline; testbox is only supported on Blacksmith runners. Skipping testbox setup." echo "available=false" >> "$GITHUB_OUTPUT" exit 0 fi