From fa84f08b25731d70873c20478e1f4a64b00bbc13 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 21 Jul 2026 23:00:19 +0100 Subject: [PATCH] ci(regen): stop the weekly no-op update PR The Telegram page ends with a "page generated in NN.NNms" comment that changes on every fetch. Change detection saw it, so the run dispatched after the codegen fix opened and merged a PR whose only content was that comment. With the merge step in place, that becomes a pointless release every week. Strip the comment on capture, and gate change detection on the generated surface instead of testdata/html/, because the snapshot file name and the latest.html symlink change every run by design. A fresh fetch now matches the committed snapshot byte for byte while the API is unchanged. --- .github/workflows/regen.yml | 12 ++++++++++-- testdata/html/snapshot_2026-07-21.html | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml index edbd312..2672fe1 100644 --- a/.github/workflows/regen.yml +++ b/.github/workflows/regen.yml @@ -29,7 +29,12 @@ jobs: DATE=$(date +%Y-%m-%d) DEST="testdata/html/snapshot_${DATE}.html" curl -fsSL --user-agent "go-telegram codegen scraper" \ - https://core.telegram.org/bots/api > "$DEST" + https://core.telegram.org/bots/api -o "$DEST.tmp" + # The page ends with a "" comment + # that changes on every fetch. Drop it, so an unchanged API produces + # a byte-identical snapshot instead of a no-op update PR. + sed '//d' "$DEST.tmp" > "$DEST" + rm "$DEST.tmp" ln -sf "snapshot_${DATE}.html" testdata/html/latest.html echo "date=$DATE" >> $GITHUB_OUTPUT echo "dest=$DEST" >> $GITHUB_OUTPUT @@ -76,7 +81,10 @@ jobs: id: diff run: | git status --porcelain - if git diff --quiet internal/spec/api.json api/ testdata/html/; then + # Gate on the generated surface only. A fresh snapshot file and the + # latest.html symlink flip every run, so including testdata/html/ + # here would open a PR on a week when Telegram changed nothing. + if git diff --quiet internal/spec/api.json api/ docs/reference/; then echo "no_changes=true" >> $GITHUB_OUTPUT fi diff --git a/testdata/html/snapshot_2026-07-21.html b/testdata/html/snapshot_2026-07-21.html index 88f3946..745397b 100644 --- a/testdata/html/snapshot_2026-07-21.html +++ b/testdata/html/snapshot_2026-07-21.html @@ -23112,4 +23112,3 @@ removePreloadInit(); -