





















@@ -0,0 +1,153 @@
1+name: NPM Telegram Beta E2E
2+3+on:
4+workflow_dispatch:
5+inputs:
6+package_spec:
7+description: Published OpenClaw package spec to test
8+required: true
9+default: openclaw@beta
10+type: string
11+provider_mode:
12+description: QA provider mode
13+required: true
14+default: mock-openai
15+type: choice
16+options:
17+ - mock-openai
18+ - live-frontier
19+scenario:
20+description: Optional comma-separated Telegram scenario ids
21+required: false
22+type: string
23+24+permissions:
25+contents: read
26+27+concurrency:
28+group: npm-telegram-beta-e2e-${{ github.run_id }}
29+cancel-in-progress: false
30+31+env:
32+FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
33+NODE_VERSION: "24.x"
34+PNPM_VERSION: "10.33.0"
35+36+jobs:
37+authorize_actor:
38+name: Authorize workflow actor
39+runs-on: blacksmith-8vcpu-ubuntu-2404
40+steps:
41+ - name: Require main workflow ref
42+env:
43+WORKFLOW_REF: ${{ github.ref }}
44+run: |
45+ set -euo pipefail
46+ if [[ "${WORKFLOW_REF}" != "refs/heads/main" ]]; then
47+ echo "NPM Telegram beta E2E must be dispatched from main so workflow logic stays controlled." >&2
48+ exit 1
49+ fi
50+51+ - name: Require maintainer-level repository access
52+uses: actions/github-script@v8
53+with:
54+script: |
55+ const allowed = new Set(["admin", "maintain", "write"]);
56+ const { owner, repo } = context.repo;
57+ const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
58+ owner,
59+ repo,
60+ username: context.actor,
61+ });
62+ const permission = data.permission;
63+ core.info(`Actor ${context.actor} permission: ${permission}`);
64+ if (!allowed.has(permission)) {
65+ core.setFailed(
66+ `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`,
67+ );
68+ }
69+70+ run_npm_telegram_beta_e2e:
71+name: Run published npm Telegram E2E
72+needs: authorize_actor
73+runs-on: blacksmith-32vcpu-ubuntu-2404
74+timeout-minutes: 60
75+environment: qa-live-shared
76+steps:
77+ - name: Checkout main
78+uses: actions/checkout@v6
79+with:
80+ref: ${{ github.sha }}
81+fetch-depth: 1
82+83+ - name: Setup Node environment
84+uses: ./.github/actions/setup-node-env
85+with:
86+node-version: ${{ env.NODE_VERSION }}
87+pnpm-version: ${{ env.PNPM_VERSION }}
88+install-bun: "true"
89+90+ - name: Validate inputs and secrets
91+env:
92+PACKAGE_SPEC: ${{ inputs.package_spec }}
93+PROVIDER_MODE: ${{ inputs.provider_mode }}
94+OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
95+OPENCLAW_QA_CONVEX_SITE_URL: ${{ secrets.OPENCLAW_QA_CONVEX_SITE_URL }}
96+OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
97+shell: bash
98+run: |
99+ set -euo pipefail
100+101+ if [[ ! "${PACKAGE_SPEC}" =~ ^openclaw@(beta|latest|[0-9]{4}\.[1-9][0-9]*\.[1-9][0-9]*(-[1-9][0-9]*|-beta\.[1-9][0-9]*)?)$ ]]; then
102+ echo "package_spec must be openclaw@beta, openclaw@latest, or an exact OpenClaw release version; got: ${PACKAGE_SPEC}" >&2
103+ exit 1
104+ fi
105+106+ require_var() {
107+ local key="$1"
108+ if [[ -z "${!key:-}" ]]; then
109+ echo "Missing required ${key}." >&2
110+ exit 1
111+ fi
112+ }
113+114+ require_var OPENCLAW_QA_CONVEX_SITE_URL
115+ require_var OPENCLAW_QA_CONVEX_SECRET_CI
116+ if [[ "${PROVIDER_MODE}" == "live-frontier" ]]; then
117+ require_var OPENAI_API_KEY
118+ fi
119+120+ - name: Run npm Telegram beta E2E
121+id: run_lane
122+shell: bash
123+env:
124+OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
125+OPENCLAW_NPM_TELEGRAM_PACKAGE_SPEC: ${{ inputs.package_spec }}
126+OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE: ${{ inputs.provider_mode }}
127+OPENCLAW_NPM_TELEGRAM_CREDENTIAL_SOURCE: convex
128+OPENCLAW_NPM_TELEGRAM_CREDENTIAL_ROLE: ci
129+OPENCLAW_QA_CONVEX_SITE_URL: ${{ secrets.OPENCLAW_QA_CONVEX_SITE_URL }}
130+OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
131+OPENCLAW_QA_REDACT_PUBLIC_METADATA: "1"
132+INPUT_SCENARIO: ${{ inputs.scenario }}
133+run: |
134+ set -euo pipefail
135+136+ output_dir=".artifacts/qa-e2e/npm-telegram-beta-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
137+ echo "output_dir=${output_dir}" >> "$GITHUB_OUTPUT"
138+ export OPENCLAW_NPM_TELEGRAM_OUTPUT_DIR="${output_dir}"
139+140+ if [[ -n "${INPUT_SCENARIO// }" ]]; then
141+ export OPENCLAW_NPM_TELEGRAM_SCENARIOS="${INPUT_SCENARIO}"
142+ fi
143+144+ pnpm test:docker:npm-telegram-live
145+146+ - name: Upload npm Telegram E2E artifacts
147+if: always()
148+uses: actions/upload-artifact@v4
149+with:
150+name: npm-telegram-beta-e2e-${{ github.run_id }}-${{ github.run_attempt }}
151+path: ${{ steps.run_lane.outputs.output_dir }}
152+retention-days: 14
153+if-no-files-found: warn
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。