mirror of
https://github.com/tiennm99/awesome-ai-dev-tools.git
synced 2026-10-11 03:13:05 +00:00
ci: verify the build before committing refreshed data
The CI failure on the merge commit was the one-time bootstrap ordering problem: `go run . -build` ran before any data/metadata.json existed. The nightly updater has since committed one, so the tree builds — but that commit was pushed with GITHUB_TOKEN, which by design does not re-trigger workflows, so CI never re-ran and main's status stayed red. That exposes a standing gap rather than a one-off: every nightly refresh commits the exact data the build consumes, and none of those commits run CI. A refresh that broke the build would first be noticed by Cloudflare at deploy time. Run `go run . -build` in the update workflow between the fetch and the commit, so data that does not build is never committed. Add workflow_dispatch to CI so a bot-pushed commit can still be verified on demand.
This commit is contained in:
1 parent
8eeda94f82
commit
b8e606f35c
3 files changed
+25
-6
No files matched your search
@@ -2,6 +2,10 @@ name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# Lets a bot-pushed commit be verified on demand: GITHUB_TOKEN pushes do not
|
||||
# trigger workflows, so the nightly refresh otherwise leaves main's CI status
|
||||
# reflecting the last human push.
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
|
||||
@@ -46,6 +46,14 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: go run .
|
||||
|
||||
# Bot commits are pushed with GITHUB_TOKEN, which by design does not
|
||||
# re-trigger workflows — so CI never runs on them. Without this step a
|
||||
# refresh that broke the build would be discovered by Cloudflare at deploy
|
||||
# time. Running the build before the commit means unbuildable data is
|
||||
# never committed in the first place.
|
||||
- name: Verify the committed data builds
|
||||
run: go run . -build
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
|
||||
+13
-6
@@ -29,11 +29,18 @@ Cloudflare's build webhook, which redeploys with the new numbers.
|
||||
|
||||
## One-time setup
|
||||
|
||||
### 1. Bootstrap `data/metadata.json`
|
||||
### 1. Check `data/metadata.json` is committed
|
||||
|
||||
The build fails without it, so generate it before connecting Cloudflare. Either
|
||||
trigger the **Update rankings** workflow manually (Actions tab →
|
||||
*Update rankings* → *Run workflow*), or run the updater locally and commit:
|
||||
The build reads it and fails without it. It is committed on `main`, kept fresh
|
||||
by the nightly **Update rankings** workflow — so this is normally just a
|
||||
sanity check:
|
||||
|
||||
```bash
|
||||
go run . -build # should print "built dist: N entries, data fetched ..."
|
||||
```
|
||||
|
||||
If it is ever missing (a fresh fork, say), regenerate it by triggering
|
||||
**Update rankings** manually from the Actions tab, or locally:
|
||||
|
||||
```bash
|
||||
export GITHUB_TOKEN=ghp_your_token_here
|
||||
@@ -85,8 +92,8 @@ are copied into `dist/` as-is and use Cloudflare's defaults.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Build fails with "data/metadata.json not found"** — the bootstrap in step 1
|
||||
has not been committed yet.
|
||||
**Build fails with "data/metadata.json not found"** — step 1 has not been
|
||||
committed yet. Trigger *Update rankings* to produce it.
|
||||
|
||||
**A newly added tool is missing from the site** — expected between merging the
|
||||
`agents.yml` entry and the next update run. The build logs a warning and omits
|
||||
|
||||
Reference in new issue
Block a user