diff --git a/.github/workflows/gallery-check.yml b/.github/workflows/gallery-check.yml new file mode 100644 index 0000000..f5d922e --- /dev/null +++ b/.github/workflows/gallery-check.yml @@ -0,0 +1,80 @@ +# Gallery check: every PR on this repository must pass `export-gallery --check` +# before it is merged (objectstack-ai/objectstack#31122). The check lives with +# the exporter in objectstack-ai/objectstack (packages/qa/scenarios, +# src/export/check.ts), so what the exporter writes and what this workflow +# accepts cannot drift. It fails the PR, one line per finding, when: +# - index.json does not match the exporter's schema; +# - an index entry has no complete apps/ID/ directory (source, run record, +# scorecard, transcript, at least one screenshot), or a directory under +# apps/ is not listed; +# - a .env* name, a node_modules directory, a symbolic link or a local +# absolute path appears anywhere in the tree; +# - an app's framework.version is not a stable @objectstack/cli release +# published on npm (read with `npm view @objectstack/cli versions`). +# +# It only reads: the token is contents: read, nothing is pushed or commented, +# and no file from the PR is executed. +# +# Until a release publishes @objectstack/scenarios with --check, the checker +# runs from source: objectstack-ai/objectstack checked out at the pinned commit +# OBJECTSTACK_SHA (a full SHA on its main, never a branch). Once a release +# carries it, replace the checkout, install and build steps with one step, +# `npx --yes @objectstack/scenarios@VERSION export-gallery --check .`, pinned +# to that exact version, and drop OBJECTSTACK_SHA. + +name: Gallery check + +on: + pull_request: + +permissions: + contents: read + +concurrency: + group: gallery-check-${{ github.event.pull_request.number }} + cancel-in-progress: true + +env: + # The objectstack-ai/objectstack main commit that merged `export-gallery --check` (PR #31748). + OBJECTSTACK_SHA: c2bb879fe71c16bd1d0b42708109efb7f6543d5d + +jobs: + check: + name: Gallery check + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Check out this PR + uses: actions/checkout@v7 + with: + path: gallery + persist-credentials: false + + - name: Check out the checker (objectstack at the pinned commit) + uses: actions/checkout@v7 + with: + repository: objectstack-ai/objectstack + ref: ${{ env.OBJECTSTACK_SHA }} + path: objectstack + persist-credentials: false + + - name: Set up Node + uses: actions/setup-node@v7 + with: + node-version-file: objectstack/.nvmrc + + - name: Install the checker's dependencies + working-directory: objectstack + run: | + corepack enable + pnpm install --frozen-lockfile --filter '@objectstack/scenarios...' + + - name: Build the packages the checker imports + working-directory: objectstack + env: + OS_SKIP_DTS: '1' + run: pnpm --filter '@objectstack/scenarios^...' build + + - name: export-gallery --check + working-directory: objectstack + run: pnpm --filter @objectstack/scenarios export-gallery --check "$GITHUB_WORKSPACE/gallery" diff --git a/README.md b/README.md index c4052c2..8624f85 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ The apps are general business functions, not industry verticals: sales, service, - **Run it locally.** Start a project with `npm create objectstack` and copy the app's metadata in. Run `os validate` and `os verify`, then start it with `os dev`. - **Try it in ObjectOS cloud.** A one-click trial is planned. +## How content arrives + +The content is generated. The normal path is a pull request opened by the scheduled export task after each ObjectStack release, which the maintainer reviews and merges. Every pull request must pass the gallery check (`.github/workflows/gallery-check.yml`), which fails on an `index.json` that does not match the exporter's schema, an incomplete or unlisted app directory, a stray `.env` file, `node_modules` directory or local path, or a framework version that is not a published release. Hand edits belong in `apps/README.md` only. + ## What this repository is not - Not hand-maintained. Every file under `apps/` and `index.json` is generated, and a hand edit is overwritten on the next release. @@ -56,4 +60,4 @@ Apache-2.0. See [LICENSE](./LICENSE). 覆盖的是通用职能场景,暂不按行业细分:销售、客服、采购与供应链、财务、人事、行政、项目、法务。 -本仓库的内容全部由产线生成,手工修改会在下次发版时被覆盖。毕业到应用市场的入门模板以**非受管**方式安装:装上之后,那份应用归你所有。 +本仓库的内容全部由产线生成,手工修改会在下次发版时被覆盖。正常的更新途径是:每次 ObjectStack 发版后由定时导出任务开一个 PR,维护者审阅后合并。每个 PR 都必须通过画廊检查(`.github/workflows/gallery-check.yml`)。手工修改只放在 `apps/README.md`。毕业到应用市场的入门模板以**非受管**方式安装:装上之后,那份应用归你所有。