@@ -339,8 +339,8 @@ jobs:
339339 - name : Publish
340340 if : steps.npm_package_version.outputs.already_published != 'true'
341341 env :
342- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
343- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
342+ NODE_AUTH_TOKEN : ${{ inputs.npm_dist_tag != 'extended-stable' && secrets.NPM_TOKEN || '' }}
343+ NPM_TOKEN : ${{ inputs.npm_dist_tag != 'extended-stable' && secrets.NPM_TOKEN || '' }}
344344 OPENCLAW_NPM_PUBLISH_AUTH_MODE : trusted-publisher
345345 OPENCLAW_PLUGIN_NPM_PUBLISH_TAG : ${{ inputs.npm_dist_tag == 'extended-stable' && inputs.npm_dist_tag || '' }}
346346 run : bash scripts/plugin-npm-publish.sh --publish "${{ matrix.plugin.packageDir }}"
@@ -351,46 +351,10 @@ jobs:
351351 PACKAGE_VERSION : ${{ matrix.plugin.version }}
352352 run : node scripts/verify-plugin-npm-published-runtime.mjs "${PACKAGE_NAME}@${PACKAGE_VERSION}"
353353
354- reconcile_plugins_npm :
354+ verify_plugins_npm :
355355 needs : [preview_plugins_npm, publish_plugins_npm]
356356 if : ${{ always() && github.event_name == 'workflow_dispatch' && inputs.npm_dist_tag == 'extended-stable' && needs.preview_plugins_npm.result == 'success' && (needs.publish_plugins_npm.result == 'success' || (needs.preview_plugins_npm.outputs.has_candidates == 'false' && needs.publish_plugins_npm.result == 'skipped')) }}
357357 runs-on : ubuntu-latest
358- environment : npm-release
359- permissions :
360- contents : read
361- strategy :
362- fail-fast : false
363- matrix :
364- plugin : ${{ fromJson(needs.preview_plugins_npm.outputs.all_matrix) }}
365- steps :
366- - name : Reconcile extended-stable tag
367- env :
368- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
369- PACKAGE_NAME : ${{ matrix.plugin.packageName }}
370- PACKAGE_VERSION : ${{ matrix.plugin.version }}
371- run : |
372- set -euo pipefail
373- exact_version="$(npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version 2>/dev/null || true)"
374- if [[ "${exact_version}" != "${PACKAGE_VERSION}" ]]; then
375- echo "Cannot reconcile ${PACKAGE_NAME}@extended-stable: ${PACKAGE_NAME}@${PACKAGE_VERSION} is not published." >&2
376- exit 1
377- fi
378- tagged_version="$(npm view "${PACKAGE_NAME}@extended-stable" version 2>/dev/null || true)"
379- if [[ "${tagged_version}" == "${PACKAGE_VERSION}" ]]; then
380- echo "${PACKAGE_NAME}@extended-stable already points to ${PACKAGE_VERSION}."
381- exit 0
382- fi
383- userconfig="$(mktemp)"
384- trap 'rm -f "${userconfig}"' EXIT
385- chmod 0600 "${userconfig}"
386- printf '//registry.npmjs.org/:_authToken=%s\n' "${NPM_TOKEN}" > "${userconfig}"
387- NPM_CONFIG_USERCONFIG="${userconfig}" npm dist-tag add "${PACKAGE_NAME}@${PACKAGE_VERSION}" extended-stable
388- echo "Reconciled ${PACKAGE_NAME}@extended-stable from ${tagged_version:-<missing>} to ${PACKAGE_VERSION}."
389-
390- verify_plugins_npm :
391- needs : [preview_plugins_npm, reconcile_plugins_npm]
392- if : ${{ always() && github.event_name == 'workflow_dispatch' && inputs.npm_dist_tag == 'extended-stable' && needs.preview_plugins_npm.result == 'success' && needs.reconcile_plugins_npm.result == 'success' }}
393- runs-on : ubuntu-latest
394358 permissions :
395359 contents : read
396360 strategy :
@@ -431,4 +395,5 @@ jobs:
431395 fi
432396 done
433397 echo "npm registry did not converge for ${PACKAGE_NAME}@${PACKAGE_VERSION} (exact=${exact_version:-missing}, extended-stable=${tagged_version:-missing})." >&2
398+ echo "This OIDC-only source workflow does not mutate tags on an already-published package; use credential-isolated release tooling for manual tag repair." >&2
434399 exit 1
0 commit comments