Skip to content

Commit d865592

Browse files
Merge remote-tracking branch 'origin/main' into pr-124207-prep
2 parents 15d83ee + 5626a79 commit d865592

962 files changed

Lines changed: 30263 additions & 10225 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/test-audit/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ add it yet:
1919
1. What observable behavior, invariant, or independent contract does it protect?
2020
2. What credible regression makes it fail?
2121
3. Why does existing coverage not already catch that failure? Prefer extending a
22-
table-driven case or shared fixture over a near-duplicate test.
22+
table-driven case or shared fixture over a near-duplicate test; consolidate
23+
duplicated setup in the same change.
2324
4. Does it need a production seam (export, flag, wrapper, injection hook) that no
2425
production caller needs? If yes, move the test to the real boundary instead.
2526

‎.github/workflows/openclaw-npm-release.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,7 @@ jobs:
12001200
fi
12011201
current_selector_version="$(npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version)"
12021202
current_selector_ref="v${current_selector_version}"
1203-
if ! git rev-parse --verify "${current_selector_ref}^{commit}" >/dev/null 2>&1; then
1204-
timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin \
1205-
"refs/tags/${current_selector_ref}:refs/tags/${current_selector_ref}"
1206-
fi
1207-
current_selector_sha="$(git rev-parse "${current_selector_ref}^{commit}")"
1203+
current_selector_sha="$(git -C trusted-workflow rev-parse --verify "refs/tags/${current_selector_ref}^{commit}")"
12081204
node trusted-workflow/scripts/plugin-sdk-api-release-evidence.mjs \
12091205
--manifest "$MANIFEST_FILE" \
12101206
--head "$EXPECTED_RELEASE_SHA" \

‎.github/workflows/plugin-npm-release.yml‎

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Plugin NPM Release
2-
run-name: ${{ github.event_name == 'workflow_dispatch' && (inputs.preflight_only && format('Plugin NPM Preflight [{0}] {1}', inputs.npm_dist_tag, inputs.ref) || format('Plugin NPM Release [{0}] {1}', inputs.npm_dist_tag, inputs.ref)) || format('Plugin NPM Release [default] {0}', github.sha) }}
2+
run-name: ${{ github.event_name == 'workflow_dispatch' && (inputs.preflight_only && inputs.trusted_publisher_preflight && format('Plugin NPM Trusted Publisher Preflight [{0}] {1}', inputs.npm_dist_tag, inputs.ref) || inputs.preflight_only && format('Plugin NPM Artifact Preflight [{0}] {1}', inputs.npm_dist_tag, inputs.ref) || format('Plugin NPM Release [{0}] {1}', inputs.npm_dist_tag, inputs.ref)) || format('Plugin NPM Release [default] {0}', github.sha) }}
33

44
on:
55
push:
@@ -52,6 +52,11 @@ on:
5252
required: true
5353
default: false
5454
type: boolean
55+
trusted_publisher_preflight:
56+
description: During preflight_only, verify npm trusted-publisher OIDC exchange instead of packing artifacts
57+
required: true
58+
default: false
59+
type: boolean
5560
npm_dist_tag:
5661
description: Optional npm dist-tag override
5762
required: true
@@ -99,6 +104,7 @@ jobs:
99104
env:
100105
NPM_DIST_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.npm_dist_tag || 'default' }}
101106
PREFLIGHT_ONLY: ${{ github.event_name == 'workflow_dispatch' && inputs.preflight_only || false }}
107+
TRUSTED_PUBLISHER_PREFLIGHT: ${{ github.event_name == 'workflow_dispatch' && inputs.trusted_publisher_preflight || false }}
102108
PUBLISH_SCOPE: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_scope || '' }}
103109
RELEASE_PLUGINS: ${{ github.event_name == 'workflow_dispatch' && inputs.plugins || '' }}
104110
RELEASE_PUBLISH_RUN_ID: ${{ github.event_name == 'workflow_dispatch' && inputs.release_publish_run_id || '' }}
@@ -107,6 +113,10 @@ jobs:
107113
WORKFLOW_SHA: ${{ github.workflow_sha }}
108114
run: |
109115
set -euo pipefail
116+
if [[ "${TRUSTED_PUBLISHER_PREFLIGHT}" == "true" && "${PREFLIGHT_ONLY}" != "true" ]]; then
117+
echo "trusted_publisher_preflight requires preflight_only=true." >&2
118+
exit 1
119+
fi
110120
if [[ "${PREFLIGHT_ONLY}" == "true" ]]; then
111121
if [[ "${WORKFLOW_REF}" != "refs/heads/main" ]] || [[ ! "${WORKFLOW_SHA}" =~ ^[0-9a-fA-F]{40}$ ]]; then
112122
echo "Plugin npm preflight must run from a trusted main workflow revision." >&2
@@ -318,14 +328,14 @@ jobs:
318328
319329
preview_plugin_pack:
320330
needs: preview_plugins_npm
321-
if: needs.preview_plugins_npm.outputs.has_candidates == 'true' || (github.event_name == 'workflow_dispatch' && inputs.preflight_only && needs.preview_plugins_npm.outputs.has_selection == 'true')
331+
if: (needs.preview_plugins_npm.outputs.has_candidates == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.preflight_only)) || (github.event_name == 'workflow_dispatch' && inputs.preflight_only && !inputs.trusted_publisher_preflight && needs.preview_plugins_npm.outputs.has_selection == 'true')
322332
runs-on: ubuntu-latest
323333
permissions:
324334
contents: read
325335
strategy:
326336
fail-fast: false
327337
matrix:
328-
plugin: ${{ fromJson(github.event_name == 'workflow_dispatch' && inputs.preflight_only && needs.preview_plugins_npm.outputs.all_matrix || needs.preview_plugins_npm.outputs.matrix) }}
338+
plugin: ${{ fromJson(github.event_name == 'workflow_dispatch' && inputs.preflight_only && !inputs.trusted_publisher_preflight && needs.preview_plugins_npm.outputs.all_matrix || needs.preview_plugins_npm.outputs.matrix) }}
329339
steps:
330340
- name: Checkout
331341
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -595,15 +605,15 @@ jobs:
595605
verify_plugin_npm_preflight:
596606
name: Preflight plugin npm package (${{ matrix.plugin.packageName }})
597607
needs: [preview_plugins_npm, preview_plugin_pack]
598-
if: ${{ github.event_name == 'workflow_dispatch' && ((inputs.preflight_only && needs.preview_plugins_npm.outputs.has_selection == 'true') || (!inputs.preflight_only && needs.preview_plugins_npm.outputs.has_candidates == 'true')) }}
608+
if: ${{ github.event_name == 'workflow_dispatch' && ((inputs.preflight_only && !inputs.trusted_publisher_preflight && needs.preview_plugins_npm.outputs.has_selection == 'true') || (!inputs.preflight_only && needs.preview_plugins_npm.outputs.has_candidates == 'true')) }}
599609
runs-on: ubuntu-latest
600610
permissions:
601611
actions: read
602612
contents: read
603613
strategy:
604614
fail-fast: false
605615
matrix:
606-
plugin: ${{ fromJson(inputs.preflight_only && needs.preview_plugins_npm.outputs.all_matrix || needs.preview_plugins_npm.outputs.matrix) }}
616+
plugin: ${{ fromJson(inputs.preflight_only && !inputs.trusted_publisher_preflight && needs.preview_plugins_npm.outputs.all_matrix || needs.preview_plugins_npm.outputs.matrix) }}
607617
steps:
608618
- name: Checkout trusted npm preflight tooling
609619
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -1007,6 +1017,50 @@ jobs:
10071017
echo "- Publication: **not attempted**"
10081018
} >> "$GITHUB_STEP_SUMMARY"
10091019
1020+
trusted_publisher_preflight:
1021+
name: Trusted publisher OIDC exchange
1022+
needs: preview_plugins_npm
1023+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.preflight_only && inputs.trusted_publisher_preflight && needs.preview_plugins_npm.outputs.has_selection == 'true' }}
1024+
runs-on: ubuntu-latest
1025+
environment: npm-release
1026+
permissions:
1027+
contents: read
1028+
id-token: write
1029+
steps:
1030+
- name: Checkout trusted OIDC preflight tooling
1031+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1032+
with:
1033+
persist-credentials: false
1034+
ref: ${{ github.workflow_sha }}
1035+
fetch-depth: 1
1036+
1037+
- name: Setup trusted Node
1038+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1039+
with:
1040+
node-version: ${{ env.NODE_VERSION }}
1041+
1042+
- name: Verify npm trusted-publisher exchange
1043+
env:
1044+
PLUGIN_MATRIX: ${{ needs.preview_plugins_npm.outputs.all_matrix }}
1045+
run: |
1046+
set -euo pipefail
1047+
node --input-type=module <<'NODE'
1048+
import { preflightNpmTrustedPublisher } from "./scripts/npm-trusted-publisher-preflight.mjs";
1049+
1050+
let selection;
1051+
try {
1052+
selection = JSON.parse(process.env.PLUGIN_MATRIX);
1053+
} catch {
1054+
throw new Error("Plugin npm selection is not valid JSON.");
1055+
}
1056+
if (!Array.isArray(selection) || selection.length === 0) {
1057+
throw new Error("Plugin npm selection must be a non-empty array.");
1058+
}
1059+
for (const entry of selection) {
1060+
await preflightNpmTrustedPublisher(entry?.packageName);
1061+
}
1062+
NODE
1063+
10101064
publish_plugins_npm:
10111065
needs:
10121066
[

0 commit comments

Comments
 (0)