Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/ci-cli-coverage-merge/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh" none

- name: Download compiled CLI artifact
Expand Down
1 change: 1 addition & 0 deletions .github/actions/ci-cli-coverage-shard/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh" production

- name: Validate changed live E2E mock parity
Expand Down
1 change: 1 addition & 0 deletions .github/actions/ci-compile-artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh"

- name: Compile CLI and plugin
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/ci-install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ NEMOCLAW_CI_NPM_CACHE="$npm_cache" \
NEMOCLAW_OPEN_SHELL_SDK_ARTIFACT_DIRECTORY="${RUNNER_TEMP:-$target_root/.ci-artifacts}/openshell-sdk" \
node "$trusted_root/scripts/checks/prepare-ci-npm-install.mts"

# Admission credentials belong to trusted preparation, not candidate dependency installation.
unset GITHUB_TOKEN GH_TOKEN

trusted_npmrc=""
cleanup() {
if [ -n "$trusted_npmrc" ]; then
Expand Down
1 change: 1 addition & 0 deletions .github/actions/ci-installer-integration/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh"

- name: Build installer integration artifacts
Expand Down
1 change: 1 addition & 0 deletions .github/actions/ci-plugin-coverage/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh"

- name: Run plugin coverage
Expand Down
1 change: 1 addition & 0 deletions .github/actions/ci-static-checks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ runs:
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.event_name == 'push' && github.token || '' }}
GITHUB_TOKEN: ${{ github.event_name == 'pull_request' && github.token || '' }}
run: bash "$GITHUB_ACTION_PATH/../ci-install-dependencies.sh"

- name: Verify reviewed runtime bundles
Expand Down
147 changes: 147 additions & 0 deletions .github/workflows/candidate-upgrade-admission.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# This status complements the native installer hash check; both must pass.
# Candidate files are API data. No candidate checkout or candidate code executes.
name: Security / Candidate Upgrade Admission
on:
pull_request_target:
types: [opened, reopened, synchronize, edited, ready_for_review]
issue_comment:
types: [created, edited, deleted]
permissions:
contents: read
pull-requests: read
jobs:
candidate-upgrade-admission:
if: ${{ github.repository == 'NVIDIA/NemoClaw' && ((github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.repo.full_name == 'NVIDIA/NemoClaw') || (github.event_name == 'issue_comment' && github.event.issue.pull_request && (contains(github.event.comment.body, 'NemoClaw-Upgrade-E2E:') || contains(github.event.changes.body.from, 'NemoClaw-Upgrade-E2E:')))) }}
concurrency:
group: candidate-upgrade-admission-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: false
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: read
statuses: write
outputs:
pr_number: ${{ steps.identity.outputs.pr_number }}
head_sha: ${{ steps.identity.outputs.head_sha }}
base_sha: ${{ steps.identity.outputs.base_sha }}
steps:
- name: Invalidate candidate upgrade admission
id: identity
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
script: |
if (context.repo.owner !== "NVIDIA" || context.repo.repo !== "NemoClaw") throw new Error("Unexpected upgrade repository");
if (!["pull_request_target", "issue_comment"].includes(context.eventName)) throw new Error("Unexpected upgrade event");
const marker = value => typeof value === "string" && value.includes("NemoClaw-Upgrade-E2E:");
if (context.eventName === "issue_comment" && (!context.payload.issue?.pull_request || (!marker(context.payload.comment?.body) && !marker(context.payload.changes?.body?.from)))) return;
const number = context.payload.pull_request?.number ?? context.payload.issue?.number;
if (!Number.isSafeInteger(number) || number <= 0) throw new Error("Invalid upgrade PR number");
const { data: pr } = await github.rest.pulls.get({ ...context.repo, pull_number: number });
if (pr.state !== "open") return;
if (pr.head.repo?.full_name !== "NVIDIA/NemoClaw" || pr.base.repo?.full_name !== "NVIDIA/NemoClaw" || pr.base.ref !== "main") throw new Error("Unsupported upgrade PR identity");
if (!/^[a-f0-9]{40}$/.test(pr.head.sha) || !/^[a-f0-9]{40}$/.test(pr.base.sha)) throw new Error("Invalid upgrade commits");
await github.rest.repos.createCommitStatus({
...context.repo, sha: pr.head.sha, context: "check-hash", state: "pending",
description: "Candidate upgrade trust is being checked",
target_url: context.serverUrl + "/" + context.repo.owner + "/" + context.repo.repo + "/actions/runs/" + context.runId,
});
core.setOutput("pr_number", String(number));
core.setOutput("head_sha", pr.head.sha);
core.setOutput("base_sha", pr.base.sha);
- name: Check out trusted admission code
if: ${{ steps.identity.outputs.head_sha != '' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: NVIDIA/NemoClaw
ref: ${{ steps.identity.outputs.base_sha }}
persist-credentials: false
- name: Set up trusted admission runtime
if: ${{ steps.identity.outputs.head_sha != '' }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 24.18.1
- name: Recheck candidate upgrade admission
id: admission
if: ${{ steps.identity.outputs.head_sha != '' }}
env:
GITHUB_TOKEN: ${{ github.token }}
CANDIDATE_REPOSITORY: NVIDIA/NemoClaw
CANDIDATE_SHA: ${{ steps.identity.outputs.head_sha }}
UPGRADE_PR_NUMBER: ${{ steps.identity.outputs.pr_number }}
UPGRADE_BASE_SHA: ${{ steps.identity.outputs.base_sha }}
run: node --no-warnings tools/e2e/candidate-openshell-version.mts
- name: Report current candidate upgrade admission
if: ${{ always() && steps.identity.outputs.head_sha != '' }}
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
env:
UPGRADE_PR_NUMBER: ${{ steps.identity.outputs.pr_number }}
UPGRADE_CANDIDATE_SHA: ${{ steps.identity.outputs.head_sha }}
UPGRADE_BASE_SHA: ${{ steps.identity.outputs.base_sha }}
UPGRADE_OUTCOME: ${{ steps.admission.outcome }}
with:
script: |
const { data: pr } = await github.rest.pulls.get({ ...context.repo, pull_number: Number(process.env.UPGRADE_PR_NUMBER) });
const current = pr.state === "open" && pr.head.sha === process.env.UPGRADE_CANDIDATE_SHA && pr.base.sha === process.env.UPGRADE_BASE_SHA;
const passed = current && process.env.UPGRADE_OUTCOME === "success";
await github.rest.repos.createCommitStatus({
...context.repo, sha: process.env.UPGRADE_CANDIDATE_SHA, context: "check-hash",
state: passed ? "success" : "failure",
description: passed ? "Current candidate upgrade admission passed" : "Upgrade admission failed or did not complete",
target_url: context.serverUrl + "/" + context.repo.owner + "/" + context.repo.repo + "/actions/runs/" + context.runId,
});

candidate-sdk-package:
needs: candidate-upgrade-admission
if: ${{ needs.candidate-upgrade-admission.outputs.head_sha != '' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
packages: read
steps:
- name: Check out trusted SDK producer
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: NVIDIA/NemoClaw
ref: ${{ needs.candidate-upgrade-admission.outputs.base_sha }}
persist-credentials: false
- name: Set up trusted package runtime
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 24.18.1
registry-url: https://npm.pkg.github.com
scope: "@nvidia"
- name: Install reviewed npm
uses: ./.github/actions/setup-reviewed-npm
- name: Package a newly admitted SDK
id: package
env:
GITHUB_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ needs.candidate-upgrade-admission.outputs.pr_number }}
CANDIDATE_SHA: ${{ needs.candidate-upgrade-admission.outputs.head_sha }}
UPGRADE_BASE_SHA: ${{ needs.candidate-upgrade-admission.outputs.base_sha }}
run: |
node --input-type=module <<'NODE'
import { appendFileSync } from 'node:fs';
import { join } from 'node:path';
import { packageCandidateOpenShellSdkIfRequired } from './scripts/checks/package-openshell-sdk-for-pr.mts';
import { githubRequest } from './tools/e2e/base-image-publication.mts';
const identity = { prNumber: Number(process.env.UPGRADE_PR_NUMBER), candidateSha: process.env.CANDIDATE_SHA, baseSha: process.env.UPGRADE_BASE_SHA };
const result = await packageCandidateOpenShellSdkIfRequired(join(process.env.RUNNER_TEMP, 'candidate-sdk'), identity, path => githubRequest(path, process.env.GITHUB_TOKEN));
appendFileSync(process.env.GITHUB_OUTPUT, `required=${result.required}\n`);
if (result.required) appendFileSync(process.env.GITHUB_OUTPUT, `bundle_name=${result.bundleName}\nartifact_name=${result.artifactName}\n`);
NODE
- name: Upload the verified candidate SDK
if: steps.package.outputs.required == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: ${{ steps.package.outputs.bundle_name }}
path: ${{ runner.temp }}/candidate-sdk/${{ steps.package.outputs.artifact_name }}
if-no-files-found: error
retention-days: 7
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ jobs:
env:
CANDIDATE_REPOSITORY: ${{ inputs.checkout_repository || github.repository }}
CANDIDATE_SHA: ${{ inputs.checkout_sha || github.sha }}
UPGRADE_PR_NUMBER: ${{ inputs.pr_number }}
UPGRADE_BASE_SHA: ${{ inputs.base_sha }}
GITHUB_TOKEN: ${{ github.token }}
run: node --no-warnings tools/e2e/candidate-openshell-version.mts

Expand Down Expand Up @@ -816,6 +818,7 @@ jobs:
scripts/check-dist-sourcemaps.mts
scripts/audit-reviewed-npm-graph.mts
scripts/checks/prepare-ci-npm-install.mts
scripts/lib/reviewed-ci-npm-install.mts
scripts/lib/openclaw-npm-remediation.mts
scripts/lib/reviewed-npm-archive.mts
scripts/lib/reviewed-npm-cache.mts
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/installer-hash-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ on:

permissions:
contents: read
pull-requests: read

jobs:
check-hash:
Expand Down Expand Up @@ -69,6 +70,11 @@ jobs:
.github/actions/ci-installer-hash-check
scripts/check-installer-hash.sh
scripts/checks/extract-installer-pins.mts
scripts/checks/openshell-trust-data.mts
ci/openshell-upgrade-trust.json
tools/e2e/candidate-openshell-trust.mts
tools/e2e/candidate-upgrade-admission.mts
tools/e2e/base-image-publication.mts
sparse-checkout-cone-mode: false

- name: Set up trusted installer hash parser runtime
Expand All @@ -87,6 +93,11 @@ jobs:
- name: Verify pull request installer hashes from reviewed code
if: github.event_name == 'pull_request'
uses: ./.trusted-installer-hash/.github/actions/ci-installer-hash-check
env:
GITHUB_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ github.event.pull_request.number }}
UPGRADE_CANDIDATE_SHA: ${{ github.event.pull_request.head.sha }}
UPGRADE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
with:
repo-root: ${{ github.workspace }}

Expand Down
Loading