@happyvertical/github-actions

中文文档
0.113.1发布于 2026/11/17MITTypeScriptES Module近 30 天下载 5543

可重复使用的 GitHub 动作工具,用于发行分解、公关验证和工作流程自动化

中文使用文档
文档目录12 节
  1. 安装
  2. CLI 使用量
  3. 曲线
  4. 标签
  5. 配置
  6. 程序化 API
  7. 问题 Trage
  8. 规划
  9. 标签管理
  10. 共用水电费
  11. 建筑
  12. 许可证

@happyvertical/github-动作

GitHub Actions为CI/CD自动化服务。 提供AI动力的发行分解(标签,重复检测,项目板管理),执行规划并附有"就绪验证定义",以及标准化的标签管理. 用途 @happyvertical/repos 财务报告和审定财务报表 @happyvertical/projects 用于 GitHub API 交互.

安装

npm install @happyvertical/github-actions

同伴依赖性 : @happyvertical/repos, (中文(简体) ), @happyvertical/projects。 。 。 .

CLI 使用量

该软件包提供了两个CLI命令:

曲线

在 GitHub 动作工作流程中运行 AI 驱动的发行分解 :

# Required env vars: GITHUB_TOKEN, GITHUB_REPOSITORY, ISSUE_NUMBER, ISSUE_TITLE, ISSUE_AUTHOR
# Optional: ISSUE_BODY, CONFIG (path to config file or JSON string)
npx @happyvertical/github-actions triage

标签

对寄存器应用标准化标签(类型、优先级、大小、状态、代理) :

github-actions labels --owner happyvertical --repo sdk --dry-run
github-actions labels --owner happyvertical --repo sdk --include-area --area core --area api

配置

创建一个 .github/triage-config.json数字 :

{
  "repoDescription": "TypeScript monorepo for AI agent development",
  "packagePattern": "@happyvertical/*",
  "packageExamples": ["@happyvertical/ai", "@happyvertical/sql"],
  "projectEnabled": true,
  "projectId": "PVT_kwDOB9Y8ns4A8-TY",
  "statusFieldId": "PVTSSF_lADOB9Y8ns4A8-TYzgw0GaY",
  "statusOptions": {
    "To Do": "c0c9ab27",
    "In Progress": "ce670088",
    "Review & Testing": "ee1f96bd"
  }
}
外地类型需求说明
repoDescription字符串对AI背景简介
packagePattern字符串没有Monorepo软件包模式(例如, @happyvertical/*(中文(简体) )
packageExamples字符串 []没有AI 指导的示例包名
projectEnabled布尔没有启用 GitHub 项目 V2 集成
projectId字符串如果项目工程 V2 ID
statusFieldId字符串如果项目状态字段标识
statusOptions对象如果项目选项 ID 映射的状态名称

程序化 API

问题 Trage

import { triageIssue } from '@happyvertical/github-actions';

const result = await triageIssue({
  token: process.env.GITHUB_TOKEN!,
  owner: 'happyvertical',
  repo: 'sdk',
  issueNumber: 123,
  issueTitle: 'Add Redis cache support',
  issueBody: 'We need distributed caching...',
  issueAuthor: 'username',
  config: {
    repoDescription: 'TypeScript monorepo for AI agent development',
    packagePattern: '@happyvertical/*',
    projectEnabled: false,
  },
});

Triage用AI(GitHub Models API)来分析这个问题,应用类型/优先级/大小标签,搜索复制品,张贴有条理的评论,并可选择更新项目板.

规划

import { startPlanning, completePlanning } from '@happyvertical/github-actions';

// Generate an AI implementation plan and post it as a comment
const planResult = await startPlanning(context);

// Validate Definition of Ready and move to Ready status
const completeResult = await completePlanning(context);

标签管理

import {
  getAllStandardLabels,
  getLabelsByCategory,
  migrateLabel,
} from '@happyvertical/github-actions';

const allLabels = getAllStandardLabels(); // type, priority, size, status, agent
const bugLabels = getLabelsByCategory('type');
const newName = migrateLabel('enhancement'); // → 'type: feature'

共用水电费

import {
  createRepository,
  createProject,
  getAICompletion,
  parseAIJson,
} from '@happyvertical/github-actions';

// Adapter factories for @happyvertical/repos and @happyvertical/projects
const repo = await createRepository(token, 'happyvertical', 'sdk');
const project = await createProject(token, projectId, statusFieldId, statusOptions);

// AI completion with auto-provider selection (GitHub Models → OpenAI → Anthropic)
const response = await getAICompletion([
  { role: 'system', content: 'You are a helpful assistant.' },
  { role: 'user', content: 'Analyze this issue...' },
]);

建筑

  • triage/ ——问题分解:AI分析,标签,重复检测,项目板更新
  • planning/ 实施规划:AI计划生成,即期验证的定义
  • shared/ ——AI客户端(GitHub Models,OpenAI,Anthropic),GitHub API帮助器,标签定义,项目公用事业,适配器工厂
  • cli.ts ——CLI入站点triage, (中文(简体) ), labels 命令)

许可证

麻省理工学院

版本与发布记录

@happyvertical/github-actions 共发布 132 个版本,首次发布于 2026/06/23;过去 12 个月发布了 132 个版本。

版本发布日期距今
0.113.1latest2026/11/17今天
0.113.02026/11/152 天前
0.112.32026/11/134 天前
0.112.22026/11/125 天前
0.112.02026/11/125 天前
0.112.12026/11/125 天前

关于 @happyvertical/github-actions 的常见问题

@happyvertical/github-actions 是什么?

可重复使用的 GitHub 动作工具,用于发行分解、公关验证和工作流程自动化

如何安装 @happyvertical/github-actions?

在项目目录运行 npm install @happyvertical/github-actions,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 github-actions、have-github-actions-context,可以用 npx github-actions 直接运行。

@happyvertical/github-actions 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@happyvertical/github-actions 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@happyvertical/github-actions 可以商用吗?

@happyvertical/github-actions 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@happyvertical/github-actions 的下载量有多少?

根据 npm 官方下载统计,@happyvertical/github-actions 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,543 次,日均约 185 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@happyvertical/github-actions 还在维护吗?

最新版本 0.113.1 发布于 2026/11/17(今天);至今共发布 132 个版本,其中过去 12 个月发布了 132 个;首次发布于 2026/06/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。