Skip to content

Commit dc49af2

Browse files
QSchlegelclaude
andcommitted
fix: skip CI smoke gracefully when secrets are not configured
The workflow now checks for SMOKE_* secrets before running and skips cleanly if they are missing. The bootstrap script also exits 0 with a message instead of failing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 11d9958 commit dc49af2

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/ci-smoke-preprod.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,31 @@ jobs:
2424
with:
2525
node-version: 20
2626

27+
- name: Check secrets configured
28+
id: check-secrets
29+
run: |
30+
if [ -z "$API_BASE_URL" ]; then
31+
echo "configured=false" >> "$GITHUB_OUTPUT"
32+
echo "Smoke test skipped: SMOKE_* secrets not configured."
33+
else
34+
echo "configured=true" >> "$GITHUB_OUTPUT"
35+
fi
36+
2737
- name: Install dependencies
38+
if: steps.check-secrets.outputs.configured == 'true'
2839
run: npm ci
2940

3041
- name: Stage 1 - Bootstrap wallets
42+
if: steps.check-secrets.outputs.configured == 'true'
3143
run: npx tsx scripts/ci-smoke/create-wallets.ts
3244

3345
- name: Stage 2 - Run route chain
46+
if: steps.check-secrets.outputs.configured == 'true'
3447
run: npx tsx scripts/ci-smoke/run-route-chain.ts
3548

3649
- name: Upload smoke artifacts
3750
uses: actions/upload-artifact@v4
38-
if: always()
51+
if: always() && steps.check-secrets.outputs.configured == 'true'
3952
with:
4053
name: smoke-report
4154
path: ci-artifacts/

scripts/ci-smoke/create-wallets.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,25 @@ import { writeContext } from "./lib/context";
2222
import { botAuth, createWallet } from "../bot-ref/bot-client";
2323
import type { Context } from "./scenarios/types";
2424

25+
const REQUIRED_ENV_VARS = [
26+
"API_BASE_URL",
27+
"SIGNER_MNEMONIC_1",
28+
"SIGNER_MNEMONIC_2",
29+
"BOT_MNEMONIC",
30+
"BOT_KEY_ID",
31+
"BOT_SECRET",
32+
];
33+
2534
const NETWORK_ID = 0; // preprod
2635

2736
async function main() {
37+
const missing = REQUIRED_ENV_VARS.filter((v) => !process.env[v]);
38+
if (missing.length > 0) {
39+
console.error("Smoke test skipped: missing env vars:", missing.join(", "));
40+
console.error("Configure the SMOKE_* secrets in GitHub repository settings.");
41+
process.exit(0);
42+
}
43+
2844
const baseUrl = requireEnv("API_BASE_URL");
2945

3046
console.log("Deriving signer addresses...");

0 commit comments

Comments
 (0)