Skip to content

Skip the download digest when it is not configured - #307

Open
jiweiyuan wants to merge 1 commit into
mainfrom
ci/stats-skip-when-unconfigured
Open

Skip the download digest when it is not configured#307
jiweiyuan wants to merge 1 commit into
mainfrom
ci/stats-skip-when-unconfigured

Conversation

@jiweiyuan

Copy link
Copy Markdown
Collaborator

Download stats has failed every night since it was added and has never once succeeded — I checked the last 30 runs. Eight consecutive reds sat on the trunk unnoticed, which is the whole problem: a check that is always red is one nobody reads.

The cause is not the code. Three of its four secrets do not exist:

CF_ANALYTICS_TOKEN:      (empty)
CF_ZONE_ID: ***          (set)
TELEGRAM_BOT_TOKEN:      (empty)
TELEGRAM_CHAT_ID:        (empty)

→ CF_ANALYTICS_TOKEN and CF_ZONE_ID are required

So the script exits before doing anything, every night, forever.

This PR does not turn the digest on — it stops it lying. The job now checks its configuration first, and when secrets are missing it emits a ::notice:: naming them and skips the two steps that need them. A run that cannot do its work says so instead of failing, and a red here goes back to meaning something actually broke.

To actually enable it, add CF_ANALYTICS_TOKEN, TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to repo secrets.

Two things worth a look while you are in there, which I did not change because both alter which credential is used:

  • CLOUDFLARE_API_TOKEN already exists. If it carries Zone > Analytics > Read, the digest may only need renaming rather than a new token — but it may equally lack that scope, so I did not silently repoint it.
  • CF_ZONE_ID and CLOUDFLARE_ZONE_ID are both set, and the workflow's own comment says they are the same value. That duplication is worth collapsing.

Release Notes:

No user-facing change.

The nightly digest has failed every night since it was added and has
never once succeeded. The cause is not the code: three of its four
secrets were never set, so the script exits on `CF_ANALYTICS_TOKEN and
CF_ZONE_ID are required` before it does anything.

A check that is always red is one people stop reading, which is what
happened — eight consecutive failures went unnoticed on the trunk. Now
the job checks its configuration first and, when the secrets are
missing, emits a notice naming them and skips the two steps that need
them. A run that cannot do its work reports that instead of failing,
and a red here goes back to meaning something broke.

This does not turn the digest on. That needs CF_ANALYTICS_TOKEN,
TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID added to the repo secrets.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview Aug 16, 2026 3:30pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant