1111 - ui/src/i18n/lib/types.ts
1212 - ui/src/i18n/lib/registry.ts
1313 - scripts/control-ui-i18n.ts
14+ - .github/actions/create-generated-pr-tokens/action.yml
1415 - .github/actions/publish-generated-pr/action.yml
1516 - .github/workflows/control-ui-locale-refresh.yml
1617 release :
1920 schedule :
2021 - cron : " 23 4 * * *"
2122 workflow_dispatch :
23+ inputs :
24+ token_preflight_only :
25+ description : Verify generated PR App permissions without running locale generation.
26+ required : false
27+ default : false
28+ type : boolean
2229
2330permissions :
2431 contents : read
2532
2633concurrency :
27- group : control-ui-locale-refresh
28- # Finish the active full refresh; GitHub retains only the newest pending run for this group.
29- # Publisher overlap checks defer stale generated paths to that queued reconciliation run.
34+ group : >-
35+ ${{ github.event_name == 'workflow_dispatch' && inputs.token_preflight_only &&
36+ format('control-ui-locale-token-preflight-{0}', github.ref) ||
37+ 'control-ui-locale-refresh' }}
38+ # Full refreshes stay serialized; cheap App-permission probes get a ref-scoped group.
39+ # Publisher overlap checks defer stale generated paths to the queued full reconciliation run.
3040 cancel-in-progress : false
3141
3242jobs :
@@ -38,27 +48,57 @@ jobs:
3848 outputs :
3949 sha : ${{ steps.base.outputs.sha }}
4050 steps :
41- - name : Resolve default branch head
51+ - name : Resolve source commit
4252 id : base
4353 env :
4454 DEFAULT_BRANCH : ${{ github.event.repository.default_branch }}
4555 GH_TOKEN : ${{ github.token }}
4656 REPOSITORY : ${{ github.repository }}
57+ TOKEN_PREFLIGHT_ONLY : ${{ inputs.token_preflight_only || false }}
58+ WORKFLOW_SHA : ${{ github.workflow_sha }}
4759 run : |
4860 set -euo pipefail
49- sha="$(
50- timeout --signal=TERM --kill-after=10s 60s \
51- gh api --method GET "repos/${REPOSITORY}/commits/${DEFAULT_BRANCH}" --jq .sha
52- )"
61+ if [[ "${TOKEN_PREFLIGHT_ONLY}" == "true" ]]; then
62+ sha="${WORKFLOW_SHA}"
63+ else
64+ sha="$(
65+ timeout --signal=TERM --kill-after=10s 60s \
66+ gh api --method GET "repos/${REPOSITORY}/commits/${DEFAULT_BRANCH}" --jq .sha
67+ )"
68+ fi
5369 if [[ ! "${sha}" =~ ^[0-9a-f]{40}$ ]]; then
54- echo "Unable to resolve ${DEFAULT_BRANCH} to an exact commit." >&2
70+ echo "Unable to resolve the locale refresh source to an exact commit." >&2
5571 exit 1
5672 fi
5773 echo "sha=${sha}" >> "${GITHUB_OUTPUT}"
5874
59- refresh :
75+ publisher-preflight :
76+ name : Verify generated PR App permissions
6077 needs : resolve-base
6178 if : needs.resolve-base.result == 'success'
79+ runs-on : ubuntu-latest
80+ steps :
81+ - name : Checkout
82+ uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
83+ with :
84+ ref : ${{ needs.resolve-base.outputs.sha }}
85+ persist-credentials : false
86+ submodules : false
87+
88+ - name : Create generated PR tokens
89+ uses : ./.github/actions/create-generated-pr-tokens
90+ with :
91+ contents-client-id : Iv23liOECG0slfuhz093
92+ contents-private-key : ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
93+ pull-request-app-id : ${{ secrets.MANTIS_GITHUB_APP_ID }}
94+ pull-request-private-key : ${{ secrets.MANTIS_GITHUB_APP_PRIVATE_KEY }}
95+
96+ refresh :
97+ needs : [resolve-base, publisher-preflight]
98+ if : >-
99+ needs.resolve-base.result == 'success' &&
100+ needs.publisher-preflight.result == 'success' &&
101+ !(github.event_name == 'workflow_dispatch' && inputs.token_preflight_only)
62102 strategy :
63103 fail-fast : false
64104 max-parallel : 4
@@ -199,8 +239,12 @@ jobs:
199239
200240 finalize :
201241 name : Commit control UI locale refresh
202- needs : [resolve-base, refresh]
203- if : needs.resolve-base.result == 'success' && needs.refresh.result == 'success'
242+ needs : [resolve-base, publisher-preflight, refresh]
243+ if : >-
244+ needs.resolve-base.result == 'success' &&
245+ needs.publisher-preflight.result == 'success' &&
246+ needs.refresh.result == 'success' &&
247+ !(github.event_name == 'workflow_dispatch' && inputs.token_preflight_only)
204248 runs-on : ubuntu-latest
205249 steps :
206250 - name : Checkout
@@ -238,8 +282,8 @@ jobs:
238282 - name : Open or update generated locale PR
239283 uses : ./.github/actions/publish-generated-pr
240284 with :
241- primary-private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
242- fallback -private-key : ${{ secrets.GH_APP_PRIVATE_KEY_FALLBACK }}
285+ contents-client-id : Iv23liOECG0slfuhz093
286+ contents -private-key : ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
243287 pull-request-app-id : ${{ secrets.MANTIS_GITHUB_APP_ID }}
244288 pull-request-private-key : ${{ secrets.MANTIS_GITHUB_APP_PRIVATE_KEY }}
245289 base-branch : ${{ github.event.repository.default_branch }}
@@ -254,6 +298,7 @@ jobs:
254298 ui/src/i18n/lib/types.ts
255299 ui/src/i18n/lib/registry.ts
256300 scripts/control-ui-i18n.ts
301+ .github/actions/create-generated-pr-tokens/action.yml
257302 .github/actions/publish-generated-pr/action.yml
258303 .github/workflows/control-ui-locale-refresh.yml
259304 pr-body : |
0 commit comments