Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/freshness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,25 @@ jobs:

Let ci.yml run: it installs these exact pins with \`:Lazy! restore\`, starts the editor and runs \`:checkhealth gerrrt\`. That is the check this bump did not have while the tree lived in dotfiles-core."
fi

# The mint above is continue-on-error and the PR step falls back to GITHUB_TOKEN, so a
# key the org never shared with this repo, or an App not installed on it, used to leave
# this run GREEN while the PR it opened sat BLOCKED: GitHub starts no workflow for a PR
# that GITHUB_TOKEN opens, so ci.yml's required contexts never arrive (#16). Fail AFTER
# the PR step rather than before it: the PR still opens and can be nudged by hand, and
# the red run is the report. The same step closes Core's freshness.yml jobs;
# dotfiles-core's GITHUB-APP-AUTH.md, "A self-PR repo has a third registration".
- name: Fail if the App token was not minted
if: env.MODE == 'pr' && steps.app.outputs.token == ''
env:
APP_OUTCOME: ${{ 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 '${APP_OUTCOME}' — 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 job opened is GITHUB_TOKEN-authored and its CI will not start: $why"
{ echo "### ❌ no App token — any PR opened here will sit BLOCKED"; echo ""; echo "$why"; } >> "$GITHUB_STEP_SUMMARY"
exit 1
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ verbatim as the GitHub Release body, so a version with an empty section refuses

## [Unreleased]

### Fixed

- **The freshness bot fails when it cannot mint the fleet App token, instead of opening a
refresh PR whose CI never starts.** The org's `FLEET_APP_PRIVATE_KEY` was never shared
with this repo, so the mint step skipped, the PR step fell back to `GITHUB_TOKEN`, and
GitHub — which starts no workflow for a PR that token opens — never delivered `ci.yml`'s
six required contexts. The run stayed green and #16 sat `BLOCKED` until it was closed and
reopened by hand. With the key shared, the bot's PRs are App-authored again (#17); the new
last step reds the run if that ever stops, naming whether the key or the App install is
missing, so a missing install or key shows up as a red run rather than another stuck PR.

### Security

- **CI pins Core's `setup-core-tools` action to a commit, so GitHub can enforce SHA pinning
Expand Down
Loading