Conversation
reward-* tags pointed at PR merge commits and statistic-* tags at the default branch HEAD, so they became the nearest tag in git describe for later commits. statistic-* releases were also created without --latest=false, so the GitHub API marked them as the Latest release. - Point new reward-* / statistic-* tags at a parentless empty-tree commit (the merge commit SHA is kept in its message) so no branch reaches them; tag contents and dates are read as before - Create statistic-* releases with --latest=false - Drop the describe-based "new commits since last statistic" check, which cannot see detached tags; count-reward.ts already exits when there is no reward data for the previous month Same fix as iflytek/astron-agent#1695. Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed? The reward bot now tags a detached empty commit, and the monthly statistic release no longer becomes "Latest".
share-reward.ts/count-reward.tspoint newreward-*/statistic-*tags at a parentless empty-tree commit, created by.github/scripts/git.ts. The merge commit SHA stays in that commit's message.statistic-*releases are created with--latest=false.statistic-member-reward.ymldrops thegit describe --match "statistic-*"pre-check, which cannot see detached tags.count-reward.tsalready exits when the previous month has no reward data.Why is this needed? We hit both problems in iflytek/astron-agent, which uses the same reward scripts (Document the stable release channel and keep reward releases from taking "Latest" astron-agent#1694, fixed in chore: make vX.Y.Z the stable release channel (docs, Helm, reward tags) astron-agent#1695):
gh release createwithout--latest=falselets the API default (make_latest: true) markstatistic-2026-09as the repository's Latest release for a week. Anything that resolvesreleases/latestwould have received a reward summary instead of a product release. In skillhub, that would mean losingv0.2.x(or acli-v*release) as Latest.git describe: tags on product commits become the nearest tag for later commits. In astron-agent, 36 of the last 400 commits onmaindescribe asreward-1575-N-g…/statistic-2026-09-N-g…, compared with 12 asv1.1.1-N-g….skillhub has no reward or statistic tags yet, so this change prevents the problem before the first payout. No existing tags need migrating.
Validation
I tested this end-to-end in a sandbox repo with a local bare remote, Deno 2.9 and a fake
ghonPATH. The repo had av1.0.0tag followed by two more commits.share-reward.ts(viacreateDetachedCommit), with a reward dated last month. It createdreward-42on a commit with no parents and the empty tree (4b825dc), and the commit message records the merge SHA.count-reward.tsunmodified. It found the tag by creator date and produced@bob / CNY RMB: 300. It pushedstatistic-2026-10on a second detached commit and calledgh release create statistic-2026-10 --latest=false --notes ….git describe --tags HEADstill returnedv1.0.0-2-g…. The remote held all 3 tags, and no git identity was left in the local config.Risk
Notes