




















@@ -10,6 +10,7 @@ on:
1010type: choice
1111options:
1212 - all
13+ - gateway-runtime-boundary
1314 - plugin-boundary
1415 - plugin-sdk-package-contract
1516 - plugin-sdk-reply-runtime
@@ -22,6 +23,11 @@ on:
2223 - ".github/workflows/codeql-critical-quality.yml"
2324 - "packages/plugin-package-contract/**"
2425 - "packages/plugin-sdk/**"
26+ - "src/gateway/method-scopes.ts"
27+ - "src/gateway/protocol/**"
28+ - "src/gateway/server-methods/**"
29+ - "src/gateway/server-methods.ts"
30+ - "src/gateway/server-methods-list.ts"
2531 - "src/plugin-sdk/**"
2632 - "src/plugins/**"
2733schedule:
@@ -37,9 +43,64 @@ env:
3743permissions:
3844actions: read
3945contents: read
46+pull-requests: read
4047security-events: write
41484249jobs:
50+quality-shards:
51+name: Select Critical Quality shards
52+runs-on: blacksmith-4vcpu-ubuntu-2404
53+timeout-minutes: 5
54+outputs:
55+gateway: ${{ steps.detect.outputs.gateway }}
56+plugin: ${{ steps.detect.outputs.plugin }}
57+plugin_sdk_package: ${{ steps.detect.outputs.plugin_sdk_package }}
58+steps:
59+ - name: Detect PR shard paths
60+id: detect
61+env:
62+EVENT_NAME: ${{ github.event_name }}
63+GH_TOKEN: ${{ github.token }}
64+PR_NUMBER: ${{ github.event.pull_request.number }}
65+REPOSITORY: ${{ github.repository }}
66+run: |
67+ set -euo pipefail
68+69+ gateway=false
70+ plugin=false
71+ plugin_sdk_package=false
72+73+ if [[ "${EVENT_NAME}" != "pull_request" ]]; then
74+ gateway=true
75+ plugin=true
76+ plugin_sdk_package=true
77+ else
78+ while IFS= read -r file; do
79+ case "${file}" in
80+ .github/codeql/*|.github/workflows/codeql-critical-quality.yml)
81+ gateway=true
82+ plugin=true
83+ plugin_sdk_package=true
84+ ;;
85+ src/gateway/method-scopes.ts|src/gateway/protocol/*|src/gateway/server-methods/*|src/gateway/server-methods.ts|src/gateway/server-methods-list.ts)
86+ gateway=true
87+ ;;
88+ src/plugin-sdk/*|src/plugins/*)
89+ plugin=true
90+ ;;
91+ packages/plugin-package-contract/*|packages/plugin-sdk/*|src/plugin-sdk/*)
92+ plugin_sdk_package=true
93+ ;;
94+ esac
95+ done < <(gh api --paginate "repos/${REPOSITORY}/pulls/${PR_NUMBER}/files" --jq '.[].filename')
96+ fi
97+98+ {
99+ echo "gateway=${gateway}"
100+ echo "plugin=${plugin}"
101+ echo "plugin_sdk_package=${plugin_sdk_package}"
102+ } >> "${GITHUB_OUTPUT}"
103+43104 core-auth-secrets:
44105name: Critical Quality (core-auth-secrets)
45106if: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.profile == 'all') }}
@@ -86,7 +147,8 @@ jobs:
8614787148gateway-runtime-boundary:
88149name: Critical Quality (gateway-runtime-boundary)
89-if: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.profile == 'all') }}
150+needs: quality-shards
151+if: ${{ needs.quality-shards.outputs.gateway == 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name == 'pull_request' || github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'gateway-runtime-boundary') }}
90152runs-on: blacksmith-4vcpu-ubuntu-2404
91153timeout-minutes: 25
92154steps:
@@ -306,7 +368,8 @@ jobs:
306368307369plugin-boundary:
308370name: Critical Quality (plugin-boundary)
309-if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name == 'pull_request' || github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'plugin-boundary') }}
371+needs: quality-shards
372+if: ${{ needs.quality-shards.outputs.plugin == 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name == 'pull_request' || github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'plugin-boundary') }}
310373runs-on: blacksmith-4vcpu-ubuntu-2404
311374timeout-minutes: 25
312375steps:
@@ -328,7 +391,8 @@ jobs:
328391329392plugin-sdk-package-contract:
330393name: Critical Quality (plugin-sdk-package-contract)
331-if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name == 'pull_request' || github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'plugin-sdk-package-contract') }}
394+needs: quality-shards
395+if: ${{ needs.quality-shards.outputs.plugin_sdk_package == 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name == 'pull_request' || github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'plugin-sdk-package-contract') }}
332396runs-on: blacksmith-4vcpu-ubuntu-2404
333397timeout-minutes: 25
334398steps:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。