Files
magpie/.github/workflows/notes-mirror.yml
T
yetone d20caffae1 release: notes written again on magpie-releases are copied here each hour
GrayRabbit on Discord (11-02): the "更新内容" dialog in Chinese listed
v0.1.2634 on as raw English commit subjects. magpie-releases' release
runs got "Insufficient Balance" from DeepSeek for both the changelog
and its Chinese since v0.1.2634, so those releases went out with the
commit list and no <!-- lang:zh --> part, as v0.1.1233 to 1242 did
(#2122). magpie-releases b90a82b now writes such notes again each hour
(notes.yml) once DeepSeek answers.

- notes-mirror.yml, hourly at :53 and by hand: a release here still
  without the zh marker gets magpie-releases' notes of the same tag
  once those have it, with the mirror's footer. The app reads
  magpie-releases through usemagpie.ai, so this is the GitHub page.
- release.yml's notice on #2260 names insufficient_balance_error as a
  DeepSeek top-up and says the notes are written again by themselves.

v0.1.2634 to 2644's notes were written by hand from their commits, in
English and Chinese, on both repos' releases.

Run: actionlint 1.7.7 (mote) on notes-mirror.yml and release.yml:
nothing but release.yml's existing unknown runner labels. No Go or GUI
code changed.
Not tried: notes-mirror.yml on GitHub's runners before this push.
2026-11-02 05:22:19 +08:00

36 lines
1.6 KiB
YAML

# A release's notes are copied here once, when release.yml's mirror-release
# job publishes it. When DeepSeek turned the notes away, magpie-releases'
# notes.yml writes them again later (each hour, at :23), and this copies
# them to this repo's release of the same tag: one here still without the
# <!-- lang:zh --> marker gets magpie-releases' notes once those have it.
# The app reads magpie-releases (usemagpie.ai's /api/notes), so this is
# the GitHub page alone.
name: notes-mirror
on:
schedule:
- cron: '53 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
mirror:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Copy notes written again
run: |
set -uo pipefail
tags=$(gh release list -R "$GITHUB_REPOSITORY" -L 100 --exclude-drafts --json tagName -q '.[].tagName') || exit 1
for t in $tags; do
here=$(gh release view "$t" -R "$GITHUB_REPOSITORY" --json body -q .body) || continue
if printf '%s' "$here" | grep -qF '<!-- lang:zh -->'; then continue; fi
there=$(gh release view "$t" -R yetone/magpie-releases --json body -q .body) || continue
if ! printf '%s' "$there" | grep -qF '<!-- lang:zh -->'; then continue; fi
{ printf '%s' "$there"; printf '\n\n---\nThe same release, and the feed magpie updates from: https://github.com/yetone/magpie-releases/releases/tag/%s\n' "$t"; } > notes.md
gh release edit "$t" -R "$GITHUB_REPOSITORY" --notes-file notes.md >/dev/null && echo "$t: notes copied"
done