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(); -