mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-16 04:28:39 +00:00
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>
15 lines
639 B
TypeScript
15 lines
639 B
TypeScript
import { $ } from "npm:zx";
|
|
|
|
/**
|
|
* Create a parentless commit with an empty tree to carry reward/statistic tags.
|
|
*
|
|
* Tags pointing at product commits become the nearest tag in `git describe`,
|
|
* so downstream builds would report versions like `reward-42-3-gabc1234`
|
|
* instead of the latest release tag. Tags on a detached commit are never
|
|
* reachable from any branch and keep release tags authoritative.
|
|
*/
|
|
export async function createDetachedCommit(message: string) {
|
|
const emptyTree = (await $`git hash-object -w -t tree /dev/null`).stdout.trim();
|
|
|
|
return (await $`git commit-tree ${emptyTree} -m ${message}`).stdout.trim();
|
|
}
|