@@ -5,12 +5,11 @@ name: Track plugin releases
55# `lithe-plugin-docs`, and adds the versions and plugins not yet in the index.
66# Plugin authors only need to publish a release that follows docs/publishing.md.
77#
8- # The scan runs once per scope, and each scope keeps its own pull request:
8+ # Full scans keep one pull request per scope. Filtered scans keep one per scope and plugin.
99#
1010# - organization: plugins whose repository belongs to the Lithe-IDEA organization,
11- # including first listings. After the archives are verified, the workflow
12- # merges the pull request itself with a token of the Lithe Store Bot GitHub
13- # App, the only bot that the "Only owners merge main" ruleset lets through.
11+ # including first listings. After verification, the Store Bot attempts a merge
12+ # if configured. A maintainer merges when the bot cannot.
1413# - external: every other plugin. The pull request waits for a maintainer
1514# review, and this scope never receives the app token.
1615on :
@@ -47,21 +46,19 @@ jobs:
4746 matrix :
4847 include :
4948 - scope : organization
50- branch : bot/track-organization-releases
5149 title : " chore(index): 追踪 Lithe-IDEA 组织插件新版本"
5250 - scope : external
53- branch : bot/track-releases
5451 title : " chore(index): 追踪组织外插件新版本"
5552 env :
5653 SCOPE : ${{ matrix.scope }}
57- BRANCH : ${{ matrix.branch }}
54+ HAS_STORE_BOT_APP : ${{ matrix.scope == 'organization' && vars.STORE_BOT_APP_CLIENT_ID != '' && secrets.STORE_BOT_APP_PRIVATE_KEY != '' }}
5855 TITLE : ${{ matrix.title }}
5956 steps :
6057 # Only the organization scope may merge into main, so only it asks for the
6158 # app token. Without the app, both scopes fall back to the tokens below.
6259 - name : Create the Lithe Store Bot token
6360 id : bot
64- if : matrix.scope == 'organization' && vars.STORE_BOT_APP_CLIENT_ID != ' '
61+ if : env.HAS_STORE_BOT_APP == 'true '
6562 uses : actions/create-github-app-token@v3
6663 with :
6764 client-id : ${{ vars.STORE_BOT_APP_CLIENT_ID }}
9592 - name : Close the obsolete pull request
9693 if : steps.track.outputs.added == '0' && inputs.plugin == ''
9794 env :
95+ BRANCH : ${{ steps.track.outputs.branch }}
9896 GH_TOKEN : ${{ steps.bot.outputs.token || secrets.STORE_BOT_TOKEN || github.token }}
9997 run : |
10098 number=$(gh pr list --head "$BRANCH" --state open --json number -q '.[0].number')
@@ -119,6 +117,8 @@ jobs:
119117 id : pr
120118 if : steps.track.outputs.added != '0'
121119 env :
120+ BRANCH : ${{ steps.track.outputs.branch }}
121+ PLUGIN : ${{ inputs.plugin }}
122122 GH_TOKEN : ${{ steps.bot.outputs.token || secrets.STORE_BOT_TOKEN || github.token }}
123123 SUMMARY : ${{ steps.track.outputs.summary }}
124124 NEW_PLUGINS : ${{ steps.track.outputs.new_plugins }}
@@ -135,8 +135,11 @@ jobs:
135135
136136 list=$(echo "$SUMMARY" | tr ',' '\n' | sed 's/^ */- /')
137137 checks="已校验 SHA-256 与包内 plugin.json(id、version、pluginAPIVersion、signatureRequirement),README 总览已一并重新生成。"
138- if [ "$SCOPE" = organization ]; then
139- review="这些插件的仓库属于 Lithe-IDEA 组织,工作流会在校验通过后直接合入 main。如果这个 PR 仍处于打开状态,说明自动合入没有成功(原因见工作流日志),请维护者按 docs/maintainers.md 的清单审查后合并。"
138+ if [ -n "$PLUGIN" ]; then TITLE="$TITLE ($PLUGIN)"; fi
139+ if [ "$HAS_STORE_BOT_APP" = true ]; then
140+ review="Store Bot 将尝试合并本次校验的提交。若工作流结束后 PR 仍打开,请维护者查看合并步骤的日志,按 docs/maintainers.md 的清单审查后合并。"
141+ elif [ "$SCOPE" = organization ]; then
142+ review="此仓库未配置完整的 Store Bot 凭据,请维护者按 docs/maintainers.md 的清单审查后合并。"
140143 else
141144 review="这些插件来自 Lithe-IDEA 组织以外的仓库,维护者请按 docs/maintainers.md 的清单审查后合并。"
142145 fi
@@ -159,6 +162,7 @@ jobs:
159162 - name : Merge the organization pull request
160163 if : matrix.scope == 'organization' && steps.track.outputs.added != '0'
161164 env :
165+ BRANCH : ${{ steps.track.outputs.branch }}
162166 # Only the app can pass the ruleset, so this step never falls back to another token.
163167 GH_TOKEN : ${{ steps.bot.outputs.token }}
164168 NUMBER : ${{ steps.pr.outputs.number }}
0 commit comments