Skip to content

Commit 6ad13bb

Browse files
cjagwaniclaude
andauthored
fix(ci): write Brev credentials file so CLI authenticates on runner (#1639)
## Summary - Write `~/.brev/credentials.json` during the "Install Brev CLI" workflow step - The Brev CLI v0.6.322 does not read `BREV_API_TOKEN` from the environment — it requires a credentials file - The `brev login --token` call was removed in 374a847 (#1470), breaking all E2E runs since ## Root Cause PR #1470 replaced `brev("login", "--token", process.env.BREV_API_TOKEN)` with a `brev("ls")` pre-check (`hasAuthenticatedBrev`), but nothing writes the credentials file on the ephemeral GH Actions runner. Result: `brev ls` fails silently, `hasAuthenticatedBrev` returns false, `describe.runIf()` skips the entire suite, and CI reports success with 0 tests run. ## Evidence - Last working run (Apr 4): [23968693963](https://github.com/NVIDIA/NemoClaw/actions/runs/23968693963) — 1 passed, 988s - Broken runs (Apr 8): [24160260650](https://github.com/NVIDIA/NemoClaw/actions/runs/24160260650), [24160572779](https://github.com/NVIDIA/NemoClaw/actions/runs/24160572779), [24161141317](https://github.com/NVIDIA/NemoClaw/actions/runs/24161141317) — all 1 skipped, <1s ## Test plan - [ ] Merge to main, trigger `e2e-brev` workflow with `TEST_SUITE=full` — confirm tests actually run (not skip) Fixes #1638 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved CI end-to-end workflow: requires and validates an API token before running, securely writes and protects credential data, and verifies authentication to ensure reliable automated test runs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
1 parent d8d0d44 commit 6ad13bb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/e2e-brev.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,27 @@ jobs:
144144
cache: npm
145145

146146
- name: Install Brev CLI
147+
env:
148+
BREV_API_TOKEN: ${{ inputs.brev_token || secrets.BREV_API_TOKEN }}
147149
run: |
148150
# Brev CLI v0.6.322+ — CPU instances use `brev search cpu | brev create`
149151
# Startup scripts use `brev create --startup-script @file` (not brev start --cpu)
150152
curl -fsSL -o /tmp/brev.tar.gz "https://github.com/brevdev/brev-cli/releases/download/v0.6.322/brev-cli_0.6.322_linux_amd64.tar.gz"
151153
tar -xzf /tmp/brev.tar.gz -C /usr/local/bin brev
152154
chmod +x /usr/local/bin/brev
155+
# Brev CLI does not read BREV_API_TOKEN from env — it requires
156+
# ~/.brev/credentials.json. The login call was removed in #1470
157+
# (374a847d), breaking CI. Write the credentials file so `brev ls`
158+
# works in the test harness's hasAuthenticatedBrev check.
159+
if [ -z "${BREV_API_TOKEN:-}" ]; then
160+
echo "::error::BREV_API_TOKEN is empty — cannot authenticate Brev CLI."
161+
exit 1
162+
fi
163+
mkdir -p ~/.brev
164+
umask 077
165+
printf '{"refresh_token":"%s"}' "$BREV_API_TOKEN" > ~/.brev/credentials.json
166+
chmod 600 ~/.brev/credentials.json
167+
brev ls >/dev/null
153168
154169
- name: Install dependencies
155170
run: npm install --ignore-scripts

0 commit comments

Comments
 (0)