Skip to content

Commit 80ebb3b

Browse files
committed
fix(contracts): build exact upstream ref when npm version is unpublished
The registry returned E404 for @jackwener/opencli@1.8.8. Keep that evidence. Build the previously audited 8271afc commit and label descriptive captures as source-built. Do not silently substitute another upstream version.
1 parent 6c5c9b3 commit 80ebb3b

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

‎.github/workflows/upstream-contracts.yml‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,40 @@ jobs:
1515
- uses: actions/setup-node@v4
1616
with:
1717
node-version: '22'
18-
- name: Install pinned OpenCLI without lifecycle scripts
18+
- name: Checkout exact upstream source, not an assumed npm publication
19+
uses: actions/checkout@v7
20+
with:
21+
repository: jackwener/OpenCLI
22+
ref: 8271afc67e8504bda94c147f446ee29775d08274
23+
path: upstream-src
24+
persist-credentials: false
25+
- name: Build the locked source with dependency lifecycle scripts disabled
1926
shell: bash
2027
run: |
21-
mkdir -p upstream-evidence "$RUNNER_TEMP/opencli-prefix" "$RUNNER_TEMP/opencli-isolated-home"
22-
npm view @jackwener/opencli@1.8.8 version gitHead dist --json > upstream-evidence/npm-provenance.json
23-
npm install --prefix "$RUNNER_TEMP/opencli-prefix" --ignore-scripts --no-audit --no-fund --save-exact @jackwener/opencli@1.8.8
28+
mkdir -p upstream-evidence "$RUNNER_TEMP/opencli-isolated-home"
29+
git -C upstream-src rev-parse HEAD > upstream-evidence/upstream-head.txt
30+
npm view @jackwener/opencli@1.8.8 version gitHead dist --json > upstream-evidence/npm-provenance.json 2> upstream-evidence/npm-provenance.stderr || printf 'UNAVAILABLE_IN_REGISTRY\n' > upstream-evidence/npm-status.txt
31+
(cd upstream-src && npm ci --ignore-scripts --no-audit --no-fund && npm run build)
2432
- name: Capture only bounded version and structured help
2533
shell: bash
2634
run: |
2735
export HOME="$RUNNER_TEMP/opencli-isolated-home"
28-
CLI="$RUNNER_TEMP/opencli-prefix/node_modules/@jackwener/opencli/dist/src/main.js"
36+
CLI="$GITHUB_WORKSPACE/upstream-src/dist/src/main.js"
2937
timeout 20 node "$CLI" --version > upstream-evidence/version.txt
3038
timeout 20 node "$CLI" --help -f json > upstream-evidence/root-help.json
3139
for namespace in browser daemon auth skills plugin adapter profile; do
3240
timeout 20 node "$CLI" "$namespace" --help -f json > "upstream-evidence/$namespace-help.json"
3341
done
34-
cp "$RUNNER_TEMP/opencli-prefix/node_modules/@jackwener/opencli/cli-manifest.json" upstream-evidence/cli-manifest.json
35-
cp "$RUNNER_TEMP/opencli-prefix/node_modules/@jackwener/opencli/package.json" upstream-evidence/package.json
36-
tar -czf upstream-evidence/opencli-package.tar.gz -C "$RUNNER_TEMP/opencli-prefix/node_modules/@jackwener/opencli" dist/src cli-manifest.json package.json
42+
cp upstream-src/cli-manifest.json upstream-evidence/cli-manifest.json
43+
cp upstream-src/package.json upstream-evidence/package.json
44+
tar -czf upstream-evidence/opencli-source.tar.gz -C upstream-src src cli-manifest.json package.json package-lock.json
3745
node --version > upstream-evidence/node-version.txt
3846
date -u +%FT%TZ > upstream-evidence/captured-at.txt
3947
(cd upstream-evidence && sha256sum *.json *.txt *.tar.gz > SHA256SUMS)
4048
- uses: actions/upload-artifact@v7
4149
if: always()
4250
with:
43-
name: opencli-1.8.8-descriptive-${{ github.sha }}
51+
name: opencli-source-8271afc-descriptive-${{ github.sha }}
4452
path: upstream-evidence
4553
retention-days: 14
4654
if-no-files-found: error

0 commit comments

Comments
 (0)