From 41becff34b183192401545a35f7fa5402b52f6bf Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:48:45 +0800 Subject: [PATCH] ci: harden QPK GitHub App control-plane with health check and secondary key Add a read-only scheduled App health workflow and primary/secondary private-key failover for pin sync, keeping PAT only as a migration fallback. Co-authored-by: Cursor Co-Authored-By: Codex --- .../workflows/open-downstream-qpk-pin-prs.yml | 52 +++++- .github/workflows/qpk-github-app-health.yml | 164 ++++++++++++++++++ docs/qpk_repo_sync_auth.zh-CN.md | 56 +++++- tests/test_qpk_github_app_health_workflow.py | 105 +++++++++++ tests/test_update_qpk_pin_workflow.py | 7 + 5 files changed, 370 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/qpk-github-app-health.yml create mode 100644 tests/test_qpk_github_app_health_workflow.py diff --git a/.github/workflows/open-downstream-qpk-pin-prs.yml b/.github/workflows/open-downstream-qpk-pin-prs.yml index 855534e6..215226ce 100644 --- a/.github/workflows/open-downstream-qpk-pin-prs.yml +++ b/.github/workflows/open-downstream-qpk-pin-prs.yml @@ -37,6 +37,7 @@ jobs: env: QSL_GITHUB_APP_ID: ${{ secrets.QSL_GITHUB_APP_ID }} QSL_GITHUB_APP_PRIVATE_KEY: ${{ secrets.QSL_GITHUB_APP_PRIVATE_KEY }} + QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY: ${{ secrets.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 @@ -50,8 +51,11 @@ jobs: python -m pip install --upgrade pip uv type -p gh >/dev/null || (type -p apt-get >/dev/null && sudo apt-get update -qq && sudo apt-get install -y -qq gh) - - name: Mint short-lived QSL GitHub App token - id: qsl_app_token + # Official create-github-app-token accepts a single private-key input. + # Primary is tried first; secondary mints only when primary did not succeed. + - name: Mint App token (primary) + id: app_token_primary + continue-on-error: true if: env.QSL_GITHUB_APP_ID != '' && env.QSL_GITHUB_APP_PRIVATE_KEY != '' uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 with: @@ -75,10 +79,39 @@ jobs: UsEquitySnapshotPipelines CryptoLivePoolPipelines + - name: Mint App token (secondary) + id: app_token_secondary + continue-on-error: true + if: >- + env.QSL_GITHUB_APP_ID != '' && + env.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY != '' && + steps.app_token_primary.outcome != 'success' + uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + with: + app-id: ${{ env.QSL_GITHUB_APP_ID }} + private-key: ${{ env.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY }} + owner: QuantStrategyLab + repositories: | + QuantPlatformKit + CnEquityStrategies + HkEquityStrategies + UsEquityStrategies + CryptoStrategies + InteractiveBrokersPlatform + LongBridgePlatform + CharlesSchwabPlatform + FirstradePlatform + BinancePlatform + QmtPlatform + CnEquitySnapshotPipelines + HkEquitySnapshotPipelines + UsEquitySnapshotPipelines + CryptoLivePoolPipelines + - name: Open downstream pin sync PRs id: sync env: - QSL_REPO_SYNC_TOKEN: ${{ steps.qsl_app_token.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} + QSL_REPO_SYNC_TOKEN: ${{ steps.app_token_primary.outputs.token || steps.app_token_secondary.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} QSL_PIN_PHASE: ${{ github.event_name == 'workflow_dispatch' && inputs.phase || 'auto' }} QSL_PIN_MODE: ${{ github.event_name == 'workflow_dispatch' && inputs.mode || 'upgrade-affected' }} run: | @@ -98,7 +131,7 @@ jobs: if: steps.sync.outputs.missing_token != 'true' uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.8 with: - token: ${{ steps.qsl_app_token.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} + token: ${{ steps.app_token_primary.outputs.token || steps.app_token_secondary.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} commit-message: "chore(deps): reconcile coherent QSL pin bundle" title: "chore(deps): reconcile coherent QSL pin bundle" body: | @@ -117,7 +150,7 @@ jobs: - name: Queue verified strategy pin PRs if: steps.sync.outputs.missing_token != 'true' env: - QSL_REPO_SYNC_TOKEN: ${{ steps.qsl_app_token.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} + QSL_REPO_SYNC_TOKEN: ${{ steps.app_token_primary.outputs.token || steps.app_token_secondary.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} run: | set -euo pipefail qpk_sha=$(tr -d '[:space:]' < QPK_PIN) @@ -130,7 +163,7 @@ jobs: - name: Report consumer QPK pin PR hygiene if: steps.sync.outputs.missing_token != 'true' env: - QSL_REPO_SYNC_TOKEN: ${{ steps.qsl_app_token.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} + QSL_REPO_SYNC_TOKEN: ${{ steps.app_token_primary.outputs.token || steps.app_token_secondary.outputs.token || secrets.QSL_REPO_SYNC_TOKEN }} run: | set -euo pipefail qpk_sha=$(tr -d '[:space:]' < QPK_PIN) @@ -142,9 +175,9 @@ jobs: cat >> "$GITHUB_STEP_SUMMARY" <<'MD' ## Downstream QPK pin PRs were not opened - Configure `QSL_GITHUB_APP_ID` and `QSL_GITHUB_APP_PRIVATE_KEY` on - **QuantPlatformKit**. During migration, `QSL_REPO_SYNC_TOKEN` remains a - temporary fallback. + Configure `QSL_GITHUB_APP_ID`, `QSL_GITHUB_APP_PRIVATE_KEY`, and optionally + `QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY` on **QuantPlatformKit**. During + migration, `QSL_REPO_SYNC_TOKEN` remains a temporary fallback only. Org-level secrets are **not** injected reliably into this public repo on GitHub Free. Configure a **repository secret** instead (see `docs/qpk_repo_sync_auth.zh-CN.md`). @@ -157,6 +190,7 @@ jobs: Production: use a GitHub App installation token scoped to the listed QuantStrategyLab repositories with `contents:write` and `pull_requests:write`. + Binance authority PATs are separate and must not be reused here. MD - name: Summarize opened PRs diff --git a/.github/workflows/qpk-github-app-health.yml b/.github/workflows/qpk-github-app-health.yml new file mode 100644 index 00000000..8f17f9f0 --- /dev/null +++ b/.github/workflows/qpk-github-app-health.yml @@ -0,0 +1,164 @@ +name: QPK GitHub App Health + +# Read-only control-plane self-check for the QSL GitHub App used by QPK pin sync. +# Does not open PRs, mutate repos, touch Binance secrets, or grant trading authority. + +on: + schedule: + - cron: "23 */6 * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + app-health: + runs-on: ubuntu-latest + timeout-minutes: 10 + env: + QSL_GITHUB_APP_ID: ${{ secrets.QSL_GITHUB_APP_ID }} + QSL_GITHUB_APP_PRIVATE_KEY: ${{ secrets.QSL_GITHUB_APP_PRIVATE_KEY }} + QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY: ${{ secrets.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY }} + steps: + - name: Require App credentials + run: | + set -euo pipefail + if [ -z "${QSL_GITHUB_APP_ID:-}" ]; then + echo "::error title=QPK GitHub App health::missing_app_id" + exit 1 + fi + if [ -z "${QSL_GITHUB_APP_PRIVATE_KEY:-}" ] && [ -z "${QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY:-}" ]; then + echo "::error title=QPK GitHub App health::missing_app_private_key" + exit 1 + fi + + # Official create-github-app-token accepts a single private-key input. + # Safe failover uses continue-on-error + a conditional secondary mint only + # when the primary step did not succeed (failed or skipped). Do not invent + # multi-key concatenation or custom JWT minting here. + - name: Mint App token (primary) + id: app_token_primary + continue-on-error: true + if: env.QSL_GITHUB_APP_PRIVATE_KEY != '' + uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + with: + app-id: ${{ env.QSL_GITHUB_APP_ID }} + private-key: ${{ env.QSL_GITHUB_APP_PRIVATE_KEY }} + owner: QuantStrategyLab + permission-contents: read + permission-metadata: read + repositories: | + QuantPlatformKit + CnEquityStrategies + HkEquityStrategies + UsEquityStrategies + CryptoStrategies + InteractiveBrokersPlatform + LongBridgePlatform + CharlesSchwabPlatform + FirstradePlatform + BinancePlatform + QmtPlatform + CnEquitySnapshotPipelines + HkEquitySnapshotPipelines + UsEquitySnapshotPipelines + CryptoLivePoolPipelines + + - name: Mint App token (secondary) + id: app_token_secondary + continue-on-error: true + if: env.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY != '' && steps.app_token_primary.outcome != 'success' + uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + with: + app-id: ${{ env.QSL_GITHUB_APP_ID }} + private-key: ${{ env.QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY }} + owner: QuantStrategyLab + permission-contents: read + permission-metadata: read + repositories: | + QuantPlatformKit + CnEquityStrategies + HkEquityStrategies + UsEquityStrategies + CryptoStrategies + InteractiveBrokersPlatform + LongBridgePlatform + CharlesSchwabPlatform + FirstradePlatform + BinancePlatform + QmtPlatform + CnEquitySnapshotPipelines + HkEquitySnapshotPipelines + UsEquitySnapshotPipelines + CryptoLivePoolPipelines + + - name: Select App token source + id: select_token + run: | + set -euo pipefail + if [ "${{ steps.app_token_primary.outcome }}" = "success" ]; then + echo "source=primary" >> "$GITHUB_OUTPUT" + elif [ "${{ steps.app_token_secondary.outcome }}" = "success" ]; then + echo "source=secondary" >> "$GITHUB_OUTPUT" + else + echo "source=none" >> "$GITHUB_OUTPUT" + echo "::error title=QPK GitHub App health::app_token_mint_failed" + exit 1 + fi + + - name: Verify repository access and QPK_PIN readback + env: + GH_TOKEN: ${{ steps.app_token_primary.outputs.token || steps.app_token_secondary.outputs.token }} + TOKEN_SOURCE: ${{ steps.select_token.outputs.source }} + run: | + set -euo pipefail + repos=( + QuantPlatformKit + CnEquityStrategies + HkEquityStrategies + UsEquityStrategies + CryptoStrategies + InteractiveBrokersPlatform + LongBridgePlatform + CharlesSchwabPlatform + FirstradePlatform + BinancePlatform + QmtPlatform + CnEquitySnapshotPipelines + HkEquitySnapshotPipelines + UsEquitySnapshotPipelines + CryptoLivePoolPipelines + ) + failed=0 + for repo in "${repos[@]}"; do + if ! gh api "repos/QuantStrategyLab/${repo}" --jq .full_name >/dev/null; then + echo "::error title=QPK GitHub App health::repo_access_failed:${repo}" + failed=1 + fi + done + pin="$( + gh api repos/QuantStrategyLab/QuantPlatformKit/contents/QPK_PIN \ + --jq .content | base64 --decode | tr -d '[:space:]' + )" + if ! [[ "$pin" =~ ^[0-9a-f]{40}$ ]]; then + echo "::error title=QPK GitHub App health::qpk_pin_readback_invalid" + failed=1 + fi + { + echo "## QPK GitHub App health" + echo + echo "- token_source: \`${TOKEN_SOURCE}\`" + echo "- repositories_checked: ${#repos[@]}" + if [ "$failed" -eq 0 ]; then + echo "- qpk_pin_readback: ok (40-char sha)" + echo "- result: pass" + else + echo "- result: fail_closed" + fi + echo + echo "Secrets, installation tokens, and private-key material are never written here." + echo "Binance authority PATs are out of scope for this App health check." + } >> "$GITHUB_STEP_SUMMARY" + if [ "$failed" -ne 0 ]; then + exit 1 + fi diff --git a/docs/qpk_repo_sync_auth.zh-CN.md b/docs/qpk_repo_sync_auth.zh-CN.md index 0d3c486c..955c0e0e 100644 --- a/docs/qpk_repo_sync_auth.zh-CN.md +++ b/docs/qpk_repo_sync_auth.zh-CN.md @@ -3,6 +3,10 @@ `open-downstream-qpk-pin-prs` workflow 默认使用 GitHub App installation token 跨仓 push 分支并开 PR; `QSL_REPO_SYNC_TOKEN` 仅作为迁移/故障回退凭据。 +只读自检由 `qpk-github-app-health` workflow(定时 + 手动)完成:优先用主私钥签发短期 +token,仅在主钥签发未成功时使用备用私钥,再校验目标仓库访问与 `QPK_PIN` 读回,失败则 +fail-closed,摘要不含任何 secret / token / 私钥内容。 + ## 命名约定 - GitHub fine-grained PAT 的显示名统一为 `qsl-<用途>-<轮换周期>`,例如 @@ -12,9 +16,25 @@ - 其他平台的 token 迁移时沿用同一格式,例如 `qsl-binance-authority-maintenance-annual`;替换前必须先确认实际消费者和完整验证链路。 -长期方案是 GitHub App installation token:每次工作流运行时临时签发短期 token,避免个人 PAT 到期。 -App 的凭据使用 `QSL_GITHUB_APP_ID` 和 `QSL_GITHUB_APP_PRIVATE_KEY` 两个仓库 Secret;迁移期间 -工作流优先使用 App token,未配置 App 时才回退到 `QSL_REPO_SYNC_TOKEN`。 +**明确边界:Binance authority PAT(以及任何券商/交易相关 Secret)与本 App / repo-sync +凭据完全分离。** 不得把 Binance authority token 写入 +`QSL_GITHUB_APP_*` 或 `QSL_REPO_SYNC_TOKEN`,也不要用本 App 私钥去代替 Binance 恢复或 +authority 维护。 + +## Secret 清单(QuantPlatformKit 仓库级) + +| Secret | 用途 | +|---|---| +| `QSL_GITHUB_APP_ID` | GitHub App ID | +| `QSL_GITHUB_APP_PRIVATE_KEY` | 主私钥(优先签发) | +| `QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY` | 备用私钥(仅主钥签发失败/未配置时使用) | +| `QSL_REPO_SYNC_TOKEN` | 迁移期 PAT 回退;App 稳定后应撤销 | + +长期方案是 GitHub App installation token:每次工作流运行时临时签发短期 token,避免个人 +PAT 到期。`actions/create-github-app-token` 每次只接受一个 `private-key` 输入,因此双钥 +failover 通过「主钥步骤 `continue-on-error` + 仅在主钥未成功时条件签发备用钥」实现, +不拼接私钥、不自写 JWT。主钥能签发但权限不足时不会改走备用钥(同一 App 安装权限相同), +由后续仓库/`QPK_PIN` 校验 fail-closed。 ## 当前发布链说明 @@ -38,7 +58,28 @@ QPK 发布采用 release-set 两阶段流程:先生成候选 QPK 版本并验 App 私钥只存储在 GitHub Actions Secret 中,不写入仓库、工作流日志、issue 或本机文件。 -### Fine-grained PAT(仅回退方案) +4. (推荐)在 App 设置中再生成一把私钥,写入 `QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY`,供轮换/故障切换。 +5. 先手动触发 `qpk-github-app-health`,确认摘要显示 `token_source: primary`(或预期的 + secondary)且结果为 pass;再手动触发 `open-downstream-qpk-pin-prs`;App 稳定后撤销旧 PAT。 + +App 私钥只存储在 GitHub Actions Secret 中,不写入仓库、工作流日志、issue 或本机文件。 + +### 轮换与故障切换 + +1. 在 GitHub App 设置中生成新私钥,写入尚未承载生产主钥的 Secret 槽位(通常是 + `QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY`)。 +2. 手动运行 `qpk-github-app-health`:确认新钥可签发(必要时临时清空/失效主钥槽位做受控验证, + 或在主钥失败时观察 `token_source: secondary`)。 +3. 将新钥提升为主钥:把新材料写入 `QSL_GITHUB_APP_PRIVATE_KEY`,旧主钥保留在 secondary + 或撤销。 +4. 再次运行 health 与一次 `open-downstream-qpk-pin-prs` 冒烟;确认不再依赖 + `QSL_REPO_SYNC_TOKEN`。 +5. 在 App 设置中删除已退役的私钥。不要在日志、PR 或本机文件中保留 PEM 明文。 + +故障时:主钥签发失败会自动尝试 secondary;若两者都失败,pin sync 仅在迁移期回退 +`QSL_REPO_SYNC_TOKEN`,health workflow 则 fail-closed(不使用 PAT 伪装 App 健康)。 + +### Fine-grained PAT(迁移回退) 1. 打开生成页(需 Pigbibi 登录 GitHub),token 显示名使用 `qsl-github-repo-sync-annual`,有效期使用组织允许的最长期限: @@ -64,13 +105,18 @@ App 私钥只存储在 GitHub Actions Secret 中,不写入仓库、工作流 ## 验真 ```bash +gh workflow run qpk-github-app-health.yml -R QuantStrategyLab/QuantPlatformKit +# 摘要应出现 token_source / repositories_checked / result: pass,且无 secret 明文 + gh workflow run open-downstream-qpk-pin-prs.yml -R QuantStrategyLab/QuantPlatformKit # 日志应出现 Mint short-lived QSL GitHub App token、Token revoked,且同步步骤成功 +# App 路径成功时各仓 no changes needed;仅迁移期才应落到 QSL_REPO_SYNC_TOKEN ``` ## 权限要求 -PAT 需对以下仓库有 **Contents: Read and write** + **Pull requests: Read and write**: +App / PAT 需对以下仓库有 **Contents: Read and write** + **Pull requests: Read and write** +(health 校验只用只读 installation token): - QuantPlatformKit, CnEquityStrategies, HkEquityStrategies, UsEquityStrategies, CryptoStrategies - InteractiveBrokersPlatform, LongBridgePlatform, CharlesSchwabPlatform, FirstradePlatform, BinancePlatform, QmtPlatform diff --git a/tests/test_qpk_github_app_health_workflow.py b/tests/test_qpk_github_app_health_workflow.py new file mode 100644 index 00000000..2b36da8b --- /dev/null +++ b/tests/test_qpk_github_app_health_workflow.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +HEALTH_WORKFLOW_PATH = ROOT / ".github" / "workflows" / "qpk-github-app-health.yml" +DOWNSTREAM_WORKFLOW_PATH = ( + ROOT / ".github" / "workflows" / "open-downstream-qpk-pin-prs.yml" +) +AUTH_DOC_PATH = ROOT / "docs" / "qpk_repo_sync_auth.zh-CN.md" + +EXPECTED_REPOS = ( + "QuantPlatformKit", + "CnEquityStrategies", + "HkEquityStrategies", + "UsEquityStrategies", + "CryptoStrategies", + "InteractiveBrokersPlatform", + "LongBridgePlatform", + "CharlesSchwabPlatform", + "FirstradePlatform", + "BinancePlatform", + "QmtPlatform", + "CnEquitySnapshotPipelines", + "HkEquitySnapshotPipelines", + "UsEquitySnapshotPipelines", + "CryptoLivePoolPipelines", +) + +APP_TOKEN_ACTION = ( + "actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349" +) + + +def _assert_repo_list(workflow: str) -> None: + for repo in EXPECTED_REPOS: + assert repo in workflow + + +def test_github_app_health_workflow_is_read_only_fail_closed() -> None: + workflow = HEALTH_WORKFLOW_PATH.read_text(encoding="utf-8") + + assert "schedule:" in workflow + assert 'cron: "23 */6 * * *"' in workflow + assert "workflow_dispatch:" in workflow + assert "permissions:\n contents: read" in workflow + assert "QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY" in workflow + assert "Mint App token (primary)" in workflow + assert "Mint App token (secondary)" in workflow + assert "continue-on-error: true" in workflow + assert "steps.app_token_primary.outcome != 'success'" in workflow + assert APP_TOKEN_ACTION in workflow + assert "permission-contents: read" in workflow + assert "permission-metadata: read" in workflow + assert "app_token_mint_failed" in workflow + assert "repo_access_failed:" in workflow + assert "qpk_pin_readback_invalid" in workflow + assert "GITHUB_STEP_SUMMARY" in workflow + assert "token_source" in workflow + assert "QSL_REPO_SYNC_TOKEN" not in workflow + assert "secrets.QSL_REPO_SYNC_TOKEN" not in workflow + assert "echo \"$GH_TOKEN\"" not in workflow + assert "PRIVATE_KEY" not in workflow.split("Verify repository access", 1)[1] + _assert_repo_list(workflow) + assert workflow.count(APP_TOKEN_ACTION) == 2 + assert ( + workflow.index("Mint App token (primary)") + < workflow.index("Mint App token (secondary)") + < workflow.index("Select App token source") + < workflow.index("Verify repository access and QPK_PIN readback") + ) + + +def test_downstream_pin_workflow_uses_primary_secondary_then_pat_fallback() -> None: + workflow = DOWNSTREAM_WORKFLOW_PATH.read_text(encoding="utf-8") + + assert "QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY" in workflow + assert "Mint App token (primary)" in workflow + assert "Mint App token (secondary)" in workflow + assert "continue-on-error: true" in workflow + assert "steps.app_token_primary.outcome != 'success'" in workflow + assert "id: qsl_app_token" not in workflow + token_expr = ( + "steps.app_token_primary.outputs.token || " + "steps.app_token_secondary.outputs.token || " + "secrets.QSL_REPO_SYNC_TOKEN" + ) + assert workflow.count(token_expr) >= 4 + assert "temporary fallback only" in workflow or "migration" in workflow.lower() + assert "Binance authority PATs are separate" in workflow + _assert_repo_list(workflow) + assert workflow.count(APP_TOKEN_ACTION) == 2 + + +def test_repo_sync_auth_doc_covers_secondary_rotation_and_binance_boundary() -> None: + doc = AUTH_DOC_PATH.read_text(encoding="utf-8") + + assert "QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY" in doc + assert "qpk-github-app-health" in doc + assert "轮换与故障切换" in doc + assert "Binance authority" in doc + assert "完全分离" in doc + assert "continue-on-error" in doc + assert "不拼接私钥" in doc + assert "QSL_REPO_SYNC_TOKEN" in doc diff --git a/tests/test_update_qpk_pin_workflow.py b/tests/test_update_qpk_pin_workflow.py index c57b1cab..2fc0bc13 100644 --- a/tests/test_update_qpk_pin_workflow.py +++ b/tests/test_update_qpk_pin_workflow.py @@ -281,6 +281,13 @@ def test_downstream_rollout_is_scheduled_and_phase_gated() -> None: assert "merge_verified_strategy_qpk_pin_prs.py" in workflow assert "--wait-for-ci-seconds 900" in workflow assert "--poll-interval-seconds 30" in workflow + assert "Mint App token (primary)" in workflow + assert "QSL_GITHUB_APP_PRIVATE_KEY_SECONDARY" in workflow + assert ( + "steps.app_token_primary.outputs.token || " + "steps.app_token_secondary.outputs.token || " + "secrets.QSL_REPO_SYNC_TOKEN" + ) in workflow def test_staged_pin_auto_advance_is_limited_to_verified_machine_prs() -> None: