From 4f24d230b55f25c6ffa439147c6f0271f94ded74 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Mon, 23 Nov 2026 12:41:37 -0800 Subject: [PATCH] fix(sync-bots): fail the run when no fleet App token was minted nvim-sync, starship-sync and theme-sync warn when the mint is skipped or fails (#269), but the run still concludes green, and a green scheduled run reaches nobody: the PR it opens with GITHUB_TOKEN gets no CI and sits BLOCKED, as #265 did and as dotgibson/dotfiles-nvim#16 did behind the same kind of green run. Each bot now ends with a step that fails when no token was minted. It runs after the PR step, so #269's reason for a warning, letting a real drift land behind a manual nudge, still holds; its other reason, not reddening a fork, is already covered by the job-level owner guard. The error names whether the org secret/variable is not shared with this repo or the App is not installed on it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nvim-sync.yml | 23 +++++++++++++++++++++++ .github/workflows/starship-sync.yml | 23 +++++++++++++++++++++++ .github/workflows/theme-sync.yml | 23 +++++++++++++++++++++++ CHANGELOG.md | 11 +++++++++++ 4 files changed, 80 insertions(+) diff --git a/.github/workflows/nvim-sync.yml b/.github/workflows/nvim-sync.yml index ec5d198..7d45fe1 100644 --- a/.github/workflows/nvim-sync.yml +++ b/.github/workflows/nvim-sync.yml @@ -168,3 +168,26 @@ jobs: --body "Automated by the nvim-sync bot. \`dotgibson/dotfiles-nvim\` published an editor release ahead of the vendored copy here; this re-runs \`nvim-sync.ps1\`. Review the diff, let CI run, then merge." fi echo "🧩 opened/updated PR on \`$BRANCH\`" >> "$GITHUB_STEP_SUMMARY" + + # The warning above says it; this makes the run SAY it in red. #269 kept that step a + # warning so a real drift still lands, and this one keeps that: it runs AFTER the PR + # step, so the PR is already open and can be nudged by hand. What a warning could not + # do is reach anyone — a green scheduled run is read by nobody, and #265 and + # dotgibson/dotfiles-nvim#16 both sat BLOCKED behind one. The fork concern #269 also + # raised does not apply: the job-level `if:` already keeps this to the canonical repo. + # Same step as dotfiles-core's and dotfiles-nvim's freshness.yml (dotfiles-core's + # GITHUB-APP-AUTH.md, "A self-PR repo has a third registration"). + - name: Fail if no App token was minted + if: steps.app.outputs.token == '' + shell: bash + env: + MINT: ${{ steps.app.outcome }} + HAS_CLIENT_ID: ${{ vars.FLEET_APP_CLIENT_ID != '' }} + run: | + if [ "$HAS_APP_KEY" != true ] || [ "$HAS_CLIENT_ID" != true ]; then + why="FLEET_APP_PRIVATE_KEY visible: $HAS_APP_KEY, FLEET_APP_CLIENT_ID visible: $HAS_CLIENT_ID — share the org secret/variable with ${GITHUB_REPOSITORY}" + else + why="the mint ran and ended '${MINT:-unknown}' — is dotgibson-fleet-sync installed on ${GITHUB_REPOSITORY}?" + fi + echo "::error title=PR not App-authored::No App token was minted, so any PR this run opened is GITHUB_TOKEN-authored and its CI will not start: $why" + exit 1 diff --git a/.github/workflows/starship-sync.yml b/.github/workflows/starship-sync.yml index f36a41c..2ab2312 100644 --- a/.github/workflows/starship-sync.yml +++ b/.github/workflows/starship-sync.yml @@ -160,3 +160,26 @@ jobs: --body "Automated by the starship-sync bot. Core's \`starship.toml\` moved ahead of the vendored copy here; this re-runs \`starship-sync.ps1\`. Review the diff, let CI run, then merge." fi echo "🧩 opened/updated PR on \`$BRANCH\`" >> "$GITHUB_STEP_SUMMARY" + + # The warning above says it; this makes the run SAY it in red. #269 kept that step a + # warning so a real drift still lands, and this one keeps that: it runs AFTER the PR + # step, so the PR is already open and can be nudged by hand. What a warning could not + # do is reach anyone — a green scheduled run is read by nobody, and #265 and + # dotgibson/dotfiles-nvim#16 both sat BLOCKED behind one. The fork concern #269 also + # raised does not apply: the job-level `if:` already keeps this to the canonical repo. + # Same step as dotfiles-core's and dotfiles-nvim's freshness.yml (dotfiles-core's + # GITHUB-APP-AUTH.md, "A self-PR repo has a third registration"). + - name: Fail if no App token was minted + if: steps.app.outputs.token == '' + shell: bash + env: + MINT: ${{ steps.app.outcome }} + HAS_CLIENT_ID: ${{ vars.FLEET_APP_CLIENT_ID != '' }} + run: | + if [ "$HAS_APP_KEY" != true ] || [ "$HAS_CLIENT_ID" != true ]; then + why="FLEET_APP_PRIVATE_KEY visible: $HAS_APP_KEY, FLEET_APP_CLIENT_ID visible: $HAS_CLIENT_ID — share the org secret/variable with ${GITHUB_REPOSITORY}" + else + why="the mint ran and ended '${MINT:-unknown}' — is dotgibson-fleet-sync installed on ${GITHUB_REPOSITORY}?" + fi + echo "::error title=PR not App-authored::No App token was minted, so any PR this run opened is GITHUB_TOKEN-authored and its CI will not start: $why" + exit 1 diff --git a/.github/workflows/theme-sync.yml b/.github/workflows/theme-sync.yml index a6fd381..d7322ed 100644 --- a/.github/workflows/theme-sync.yml +++ b/.github/workflows/theme-sync.yml @@ -169,3 +169,26 @@ jobs: --body "Automated by the theme-sync bot. Core's \`theme/palette.toml\` moved ahead of the vendored copy here; this re-runs \`theme-sync.ps1\` and then \`gen-theme.ps1\`, so the palette and every block rendered from it move together. Review the colour diff, let CI run, then merge." fi echo "🎨 opened/updated PR on \`$BRANCH\`" >> "$GITHUB_STEP_SUMMARY" + + # The warning above says it; this makes the run SAY it in red. #269 kept that step a + # warning so a real drift still lands, and this one keeps that: it runs AFTER the PR + # step, so the PR is already open and can be nudged by hand. What a warning could not + # do is reach anyone — a green scheduled run is read by nobody, and #265 and + # dotgibson/dotfiles-nvim#16 both sat BLOCKED behind one. The fork concern #269 also + # raised does not apply: the job-level `if:` already keeps this to the canonical repo. + # Same step as dotfiles-core's and dotfiles-nvim's freshness.yml (dotfiles-core's + # GITHUB-APP-AUTH.md, "A self-PR repo has a third registration"). + - name: Fail if no App token was minted + if: steps.app.outputs.token == '' + shell: bash + env: + MINT: ${{ steps.app.outcome }} + HAS_CLIENT_ID: ${{ vars.FLEET_APP_CLIENT_ID != '' }} + run: | + if [ "$HAS_APP_KEY" != true ] || [ "$HAS_CLIENT_ID" != true ]; then + why="FLEET_APP_PRIVATE_KEY visible: $HAS_APP_KEY, FLEET_APP_CLIENT_ID visible: $HAS_CLIENT_ID — share the org secret/variable with ${GITHUB_REPOSITORY}" + else + why="the mint ran and ended '${MINT:-unknown}' — is dotgibson-fleet-sync installed on ${GITHUB_REPOSITORY}?" + fi + echo "::error title=PR not App-authored::No App token was minted, so any PR this run opened is GITHUB_TOKEN-authored and its CI will not start: $why" + exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4bf10..3dc4c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ so entries are grouped by theme rather than strict semver releases. ## [Unreleased] +### Fixed + +- **The three sync bots go red when they cannot mint the fleet App token.** `nvim-sync`, + `starship-sync` and `theme-sync` already warned (#269) when the mint was skipped or + failed, but a warning on a green scheduled run reaches nobody: the PR they then open + with `GITHUB_TOKEN` gets no CI and sits `BLOCKED`, as #265 did. Each bot now ends with a + step that fails the run in that case, after the PR step, so the PR still opens for a + manual nudge. The error says whether the org secret/variable is not shared with this + repo or the App is not installed on it. The same step closes dotfiles-core's and + dotfiles-nvim's `freshness.yml`. + ## [v1.8.1] - 2026-10-14 ### Fixed