🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
👷 ci: clone the business overlay with the LobeHub bot App token (#21411)
Innei93296186e5bf
diff --git a/.github/actions/overlay-token/action.yml b/.github/actions/overlay-token/action.ymlnew file mode 100644index 00000000000..4af8adbcfdb--- /dev/null+++ b/.github/actions/overlay-token/action.yml@@ -0,0 +1,45 @@+name: Overlay Token+description: >-+ Mint a LobeHub bot GitHub App installation token scoped to the private overlay repository. Outputs an empty token when no private key is available (fork PRs), so callers fall back to the open-source build.++inputs:+ app-id:+ description: LobeHub bot GitHub App id — pass the LOBEHUB_BOT_APP_ID repository variable+ required: true+ private-key:+ description: LobeHub bot GitHub App private key — pass the LOBEHUB_BOT_APP_PRIVATE_KEY secret+ required: false+ default: ''+ repository:+ description: Overlay repository (owner/name) — pass the OVERLAY_REPOSITORY repository variable+ required: true++outputs:+ token:+ description: Installation token with read access to the overlay repository+ value: ${{ steps.token.outputs.token }}++runs:+ using: composite+ steps:+ - name: Resolve overlay repository+ id: repo+ if: inputs.private-key != ''+ shell: bash+ env:+ OVERLAY_REPOSITORY: ${{ inputs.repository }}+ run: |+ set -euo pipefail+ : "${OVERLAY_REPOSITORY:?repository input is empty — pass the OVERLAY_REPOSITORY repository variable}"+ echo "owner=${OVERLAY_REPOSITORY%%/*}" >> "$GITHUB_OUTPUT"+ echo "name=${OVERLAY_REPOSITORY#*/}" >> "$GITHUB_OUTPUT"++ - name: Create GitHub App token+ id: token+ if: inputs.private-key != ''+ uses: actions/create-github-app-token@v2+ with:+ app-id: ${{ inputs.app-id }}+ private-key: ${{ inputs.private-key }}+ owner: ${{ steps.repo.outputs.owner }}+ repositories: ${{ steps.repo.outputs.name }}diff --git a/.github/workflows/manual-build-desktop.yml b/.github/workflows/manual-build-desktop.ymlindex 5556efe0328..2213362800b 100644--- a/.github/workflows/manual-build-desktop.yml+++ b/.github/workflows/manual-build-desktop.yml@@ -101,11 +101,19 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentuses: ./.github/actions/desktop-build-setupwith:cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Set package version@@ -183,11 +191,19 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentuses: ./.github/actions/desktop-build-setupwith:cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Set package version@@ -229,11 +245,19 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentuses: ./.github/actions/desktop-build-setupwith:cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Set package versiondiff --git a/.github/workflows/pr-build-desktop.yml b/.github/workflows/pr-build-desktop.ymlindex 01ab012a397..5b0030c10af 100644--- a/.github/workflows/pr-build-desktop.yml+++ b/.github/workflows/pr-build-desktop.yml@@ -103,11 +103,19 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentuses: ./.github/actions/desktop-build-setupwith:cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: 24.11.1# 设置 package.json 的版本号diff --git a/.github/workflows/release-desktop-beta.yml b/.github/workflows/release-desktop-beta.ymlindex d749bb7a799..e4dc08b44ea 100644--- a/.github/workflows/release-desktop-beta.yml+++ b/.github/workflows/release-desktop-beta.yml@@ -54,12 +54,32 @@ jobs:echo "⏭️ Skipping: $version is a stable release (handled by release-desktop-stable.yml)"fi+ # No checkout in this job, so the local overlay-token action is unavailable.+ - name: Resolve overlay repository+ id: overlay-repo+ if: steps.check.outputs.is_beta == 'true'+ env:+ OVERLAY_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}+ run: |+ echo "owner=${OVERLAY_REPOSITORY%%/*}" >> "$GITHUB_OUTPUT"+ echo "name=${OVERLAY_REPOSITORY#*/}" >> "$GITHUB_OUTPUT"++ - name: Create overlay token+ id: overlay-token+ if: steps.check.outputs.is_beta == 'true'+ uses: actions/create-github-app-token@v2+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ owner: ${{ steps.overlay-repo.outputs.owner }}+ repositories: ${{ steps.overlay-repo.outputs.name }}+- name: Resolve Cloud revisionid: cloud-refif: steps.check.outputs.is_beta == 'true'env:CLOUD_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}- CLOUD_TOKEN: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ CLOUD_TOKEN: ${{ steps.overlay-token.outputs.token }}run: |set -euo pipefail: "${CLOUD_REPOSITORY:?OVERLAY_REPOSITORY repository variable is not set}"@@ -102,13 +122,21 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentid: setupuses: ./.github/actions/desktop-build-setupwith:cloud-ref: ${{ needs.check-beta.outputs.cloud_ref }}cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Resolve core seqdiff --git a/.github/workflows/release-desktop-canary.yml b/.github/workflows/release-desktop-canary.ymlindex 161797a979a..39fe8feacd5 100644--- a/.github/workflows/release-desktop-canary.yml+++ b/.github/workflows/release-desktop-canary.yml@@ -166,11 +166,19 @@ jobs:echo "✅ Canary version: ${version}"echo "🏷️ Tag: ${tag}"+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Resolve Cloud revisionid: cloud-refenv:CLOUD_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}- CLOUD_TOKEN: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ CLOUD_TOKEN: ${{ steps.overlay-token.outputs.token }}run: |set -euo pipefail: "${CLOUD_REPOSITORY:?OVERLAY_REPOSITORY repository variable is not set}"@@ -276,13 +284,21 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentid: setupuses: ./.github/actions/desktop-build-setupwith:cloud-ref: ${{ needs.calculate-version.outputs.cloud_ref }}cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Resolve core seqdiff --git a/.github/workflows/release-desktop-core-ota.yml b/.github/workflows/release-desktop-core-ota.ymlindex 75a9e66499c..baad41e2847 100644--- a/.github/workflows/release-desktop-core-ota.yml+++ b/.github/workflows/release-desktop-core-ota.yml@@ -254,12 +254,21 @@ jobs:echo "version=$APP_VERSION-core.$SEQ" >> "$GITHUB_OUTPUT"echo "Next core: $APP_VERSION-core.$SEQ (seq $SEQ)"+ - name: Create overlay token+ id: overlay-token+ if: steps.gate.outputs.allowed == 'true'+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Resolve Cloud revisionid: cloud-refif: steps.gate.outputs.allowed == 'true'env:CLOUD_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}- CLOUD_TOKEN: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ CLOUD_TOKEN: ${{ steps.overlay-token.outputs.token }}run: |set -euo pipefail: "${CLOUD_REPOSITORY:?OVERLAY_REPOSITORY repository variable is not set}"@@ -291,13 +300,21 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentid: setupuses: ./.github/actions/desktop-build-setupwith:cloud-ref: ${{ needs.gate.outputs.cloud_ref }}cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Set package versiondiff --git a/.github/workflows/release-desktop-stable.yml b/.github/workflows/release-desktop-stable.ymlindex ef57dc000ae..7af0656ce89 100644--- a/.github/workflows/release-desktop-stable.yml+++ b/.github/workflows/release-desktop-stable.yml@@ -125,13 +125,33 @@ jobs:echo "✅ Stable release detected: $version"fi+ # No checkout in this job, so the local overlay-token action is unavailable.+ - name: Resolve overlay repository+ id: overlay-repo+ if: steps.check.outputs.is_stable == 'true'+ env:+ OVERLAY_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}+ run: |+ echo "owner=${OVERLAY_REPOSITORY%%/*}" >> "$GITHUB_OUTPUT"+ echo "name=${OVERLAY_REPOSITORY#*/}" >> "$GITHUB_OUTPUT"++ - name: Create overlay token+ id: overlay-token+ if: steps.check.outputs.is_stable == 'true'+ uses: actions/create-github-app-token@v2+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ owner: ${{ steps.overlay-repo.outputs.owner }}+ repositories: ${{ steps.overlay-repo.outputs.name }}+- name: Resolve Cloud revisionid: cloud-refif: steps.check.outputs.is_stable == 'true'env:REQUESTED_CLOUD_REF: ${{ inputs.cloud_ref || '' }}CLOUD_REPOSITORY: ${{ vars.OVERLAY_REPOSITORY }}- CLOUD_TOKEN: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ CLOUD_TOKEN: ${{ steps.overlay-token.outputs.token }}run: |set -euo pipefail: "${CLOUD_REPOSITORY:?OVERLAY_REPOSITORY repository variable is not set}"@@ -209,13 +229,21 @@ jobs:steps:- uses: actions/checkout@v7+ - name: Create overlay token+ id: overlay-token+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Setup build environmentid: setupuses: ./.github/actions/desktop-build-setupwith:cloud-ref: ${{ needs.check-stable.outputs.cloud_ref }}cloud-repository: ${{ vars.OVERLAY_REPOSITORY }}- cloud-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ cloud-token: ${{ steps.overlay-token.outputs.token }}node-version: ${{ env.NODE_VERSION }}- name: Resolve core seqdiff --git a/.github/workflows/verify-share.yml b/.github/workflows/verify-share.ymlindex 783aa5778f9..3dcbeca2421 100644--- a/.github/workflows/verify-share.yml+++ b/.github/workflows/verify-share.yml@@ -1,7 +1,7 @@# PR-time guard for the share micro app (apps/share). The deployed worker is# built with the private business overlay, so same-repo PRs overlay it (repo-# name and token come from the OVERLAY_REPOSITORY variable and-# OVERLAY_REPO_TOKEN secret — never hardcoded) and upload a preview version.+# name comes from the OVERLAY_REPOSITORY variable and access from a LobeHub bot+# GitHub App token — never hardcoded) and upload a preview version.# Without that configuration — fork PRs included — the workflow builds with the# open-source business stubs and dry-runs the worker upload as a pure# compile/size guard. The production deploy lives in the overlay repository,@@ -25,7 +25,7 @@ jobs:runs-on: ubuntu-latestenv:SAME_REPO: ${{ github.event.pull_request.head.repo.full_name == github.repository }}- USE_OVERLAY: ${{ github.event.pull_request.head.repo.full_name == github.repository && vars.OVERLAY_REPOSITORY != '' && secrets.LOBEHUB_CLOUD_TOKEN != '' }}+ USE_OVERLAY: ${{ github.event.pull_request.head.repo.full_name == github.repository && vars.OVERLAY_REPOSITORY != '' && secrets.LOBEHUB_BOT_APP_PRIVATE_KEY != '' }}steps:- name: Checkoutuses: actions/checkout@v7@@ -76,12 +76,21 @@ jobs:"origin/${{ github.base_ref }}" HEADfi+ - name: Create overlay token+ id: overlay-token+ if: steps.detect.outputs.should_build == 'true' && env.USE_OVERLAY == 'true'+ uses: ./.github/actions/overlay-token+ with:+ app-id: ${{ vars.LOBEHUB_BOT_APP_ID }}+ private-key: ${{ secrets.LOBEHUB_BOT_APP_PRIVATE_KEY }}+ repository: ${{ vars.OVERLAY_REPOSITORY }}+- name: Overlay business repositoryif: steps.detect.outputs.should_build == 'true' && env.USE_OVERLAY == 'true'uses: ./.github/actions/business-overlaywith:overlay-repository: ${{ vars.OVERLAY_REPOSITORY }}- overlay-token: ${{ secrets.LOBEHUB_CLOUD_TOKEN }}+ overlay-token: ${{ steps.overlay-token.outputs.token }}- name: Setup environmentif: steps.detect.outputs.should_build == 'true'