@happyvertical/github-actions 0.74.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT.md +33 -0
- package/LICENSE +7 -0
- package/README.md +147 -0
- package/dist/cli/claude-context.d.ts +3 -0
- package/dist/cli/claude-context.d.ts.map +1 -0
- package/dist/cli/claude-context.js +21 -0
- package/dist/cli/claude-context.js.map +1 -0
- package/dist/cli.d.ts +18 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +325 -0
- package/dist/cli.js.map +1 -0
- package/dist/index-v2-CqFKwTm8.js +687 -0
- package/dist/index-v2-CqFKwTm8.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +637 -0
- package/dist/index.js.map +1 -0
- package/dist/labels-cli.d.ts +20 -0
- package/dist/labels-cli.d.ts.map +1 -0
- package/dist/planning/analyze.d.ts +13 -0
- package/dist/planning/analyze.d.ts.map +1 -0
- package/dist/planning/comment.d.ts +15 -0
- package/dist/planning/comment.d.ts.map +1 -0
- package/dist/planning/definition-of-ready.d.ts +15 -0
- package/dist/planning/definition-of-ready.d.ts.map +1 -0
- package/dist/planning/index.d.ts +14 -0
- package/dist/planning/index.d.ts.map +1 -0
- package/dist/planning/types.d.ts +71 -0
- package/dist/planning/types.d.ts.map +1 -0
- package/dist/shared/adapters.d.ts +11 -0
- package/dist/shared/adapters.d.ts.map +1 -0
- package/dist/shared/ai.d.ts +43 -0
- package/dist/shared/ai.d.ts.map +1 -0
- package/dist/shared/github.d.ts +52 -0
- package/dist/shared/github.d.ts.map +1 -0
- package/dist/shared/index.d.ts +9 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/labels.d.ts +35 -0
- package/dist/shared/labels.d.ts.map +1 -0
- package/dist/shared/projects.d.ts +34 -0
- package/dist/shared/projects.d.ts.map +1 -0
- package/dist/triage/analyze.d.ts +12 -0
- package/dist/triage/analyze.d.ts.map +1 -0
- package/dist/triage/comment.d.ts +17 -0
- package/dist/triage/comment.d.ts.map +1 -0
- package/dist/triage/duplicates.d.ts +12 -0
- package/dist/triage/duplicates.d.ts.map +1 -0
- package/dist/triage/github.d.ts +5 -0
- package/dist/triage/github.d.ts.map +1 -0
- package/dist/triage/index-v2.d.ts +19 -0
- package/dist/triage/index-v2.d.ts.map +1 -0
- package/dist/triage/index.d.ts +13 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/label-v2.d.ts +20 -0
- package/dist/triage/label-v2.d.ts.map +1 -0
- package/dist/triage/label.d.ts +16 -0
- package/dist/triage/label.d.ts.map +1 -0
- package/dist/triage/project-v2.d.ts +12 -0
- package/dist/triage/project-v2.d.ts.map +1 -0
- package/dist/triage/project.d.ts +7 -0
- package/dist/triage/project.d.ts.map +1 -0
- package/dist/triage/types.d.ts +64 -0
- package/dist/triage/types.d.ts.map +1 -0
- package/metadata.json +30 -0
- package/package.json +58 -0
package/AGENT.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @happyvertical/github-actions
|
|
2
|
+
|
|
3
|
+
<!-- BEGIN AGENT:GENERATED -->
|
|
4
|
+
## Purpose
|
|
5
|
+
Reusable GitHub Actions utilities for issue triage, PR validation, and workflow automation
|
|
6
|
+
|
|
7
|
+
## Package Map
|
|
8
|
+
- Package: `@happyvertical/github-actions`
|
|
9
|
+
- Hierarchy path: `@happyvertical/sdk > packages > github-actions`
|
|
10
|
+
- Workspace position: `13 of 30` local packages
|
|
11
|
+
- Internal dependencies: `@happyvertical/projects`, `@happyvertical/repos`
|
|
12
|
+
- Internal dependents: none
|
|
13
|
+
- Knowledge graph files: `AGENT.md`, `metadata.json`, `ecosystem-manifest.json`
|
|
14
|
+
|
|
15
|
+
## Build & Test
|
|
16
|
+
```bash
|
|
17
|
+
pnpm --filter @happyvertical/github-actions build
|
|
18
|
+
pnpm --filter @happyvertical/github-actions test
|
|
19
|
+
pnpm --filter @happyvertical/github-actions clean
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Agent Correction Loops
|
|
23
|
+
- If module resolution or export errors mention a workspace dependency, build the dependency first (`pnpm --filter @happyvertical/projects build`, `pnpm --filter @happyvertical/repos build`) and then rerun `pnpm --filter @happyvertical/github-actions build`.
|
|
24
|
+
- If tests or exports fail after API, type, or bundle changes, run `pnpm --filter @happyvertical/github-actions clean` followed by `pnpm --filter @happyvertical/github-actions build` and `pnpm --filter @happyvertical/github-actions test`.
|
|
25
|
+
- If failures span multiple packages or Turborepo ordering looks wrong, run `pnpm build` and `pnpm typecheck` from the repo root before retrying package-scoped commands.
|
|
26
|
+
|
|
27
|
+
## Ecosystem Relationships
|
|
28
|
+
- Provides: Reusable GitHub Actions utilities for issue triage, PR validation, and workflow automation
|
|
29
|
+
- Implements: none
|
|
30
|
+
- Requires: @happyvertical/projects, @happyvertical/repos
|
|
31
|
+
- Stability: stable (Primary package surface is described as implemented and production-oriented.)
|
|
32
|
+
<!-- END AGENT:GENERATED -->
|
|
33
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright <2025> <Happy Vertical Corporation>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the āSoftwareā), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED āAS ISā, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# @happyvertical/github-actions
|
|
2
|
+
|
|
3
|
+
GitHub Actions utilities for CI/CD automation. Provides AI-powered issue triage (labeling, duplicate detection, project board management), implementation planning with Definition of Ready validation, and standardized label management. Uses `@happyvertical/repos` and `@happyvertical/projects` for GitHub API interactions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @happyvertical/github-actions
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `@happyvertical/repos`, `@happyvertical/projects`.
|
|
12
|
+
|
|
13
|
+
## CLI Usage
|
|
14
|
+
|
|
15
|
+
The package provides two CLI commands:
|
|
16
|
+
|
|
17
|
+
### Triage
|
|
18
|
+
|
|
19
|
+
Run AI-powered issue triage in a GitHub Actions workflow:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Required env vars: GITHUB_TOKEN, GITHUB_REPOSITORY, ISSUE_NUMBER, ISSUE_TITLE, ISSUE_AUTHOR
|
|
23
|
+
# Optional: ISSUE_BODY, CONFIG (path to config file or JSON string)
|
|
24
|
+
npx @happyvertical/github-actions triage
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Labels
|
|
28
|
+
|
|
29
|
+
Apply standardized labels (type, priority, size, status, agent) to a repository:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
github-actions labels --owner happyvertical --repo sdk --dry-run
|
|
33
|
+
github-actions labels --owner happyvertical --repo sdk --include-area --area core --area api
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Create a `.github/triage-config.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"repoDescription": "TypeScript monorepo for AI agent development",
|
|
43
|
+
"packagePattern": "@happyvertical/*",
|
|
44
|
+
"packageExamples": ["@happyvertical/ai", "@happyvertical/sql"],
|
|
45
|
+
"projectEnabled": true,
|
|
46
|
+
"projectId": "PVT_kwDOB9Y8ns4A8-TY",
|
|
47
|
+
"statusFieldId": "PVTSSF_lADOB9Y8ns4A8-TYzgw0GaY",
|
|
48
|
+
"statusOptions": {
|
|
49
|
+
"To Do": "c0c9ab27",
|
|
50
|
+
"In Progress": "ce670088",
|
|
51
|
+
"Review & Testing": "ee1f96bd"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
| Field | Type | Required | Description |
|
|
57
|
+
|-------|------|----------|-------------|
|
|
58
|
+
| `repoDescription` | string | Yes | Brief description for AI context |
|
|
59
|
+
| `packagePattern` | string | No | Monorepo package pattern (e.g., `@happyvertical/*`) |
|
|
60
|
+
| `packageExamples` | string[] | No | Example package names for AI guidance |
|
|
61
|
+
| `projectEnabled` | boolean | No | Enable GitHub Projects V2 integration |
|
|
62
|
+
| `projectId` | string | If project | Project V2 ID |
|
|
63
|
+
| `statusFieldId` | string | If project | Status field ID |
|
|
64
|
+
| `statusOptions` | object | If project | Status name to option ID mapping |
|
|
65
|
+
|
|
66
|
+
## Programmatic API
|
|
67
|
+
|
|
68
|
+
### Issue Triage
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { triageIssue } from '@happyvertical/github-actions';
|
|
72
|
+
|
|
73
|
+
const result = await triageIssue({
|
|
74
|
+
token: process.env.GITHUB_TOKEN!,
|
|
75
|
+
owner: 'happyvertical',
|
|
76
|
+
repo: 'sdk',
|
|
77
|
+
issueNumber: 123,
|
|
78
|
+
issueTitle: 'Add Redis cache support',
|
|
79
|
+
issueBody: 'We need distributed caching...',
|
|
80
|
+
issueAuthor: 'username',
|
|
81
|
+
config: {
|
|
82
|
+
repoDescription: 'TypeScript monorepo for AI agent development',
|
|
83
|
+
packagePattern: '@happyvertical/*',
|
|
84
|
+
projectEnabled: false,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Triage analyzes the issue with AI (GitHub Models API), applies type/priority/size labels, searches for duplicates, posts a structured comment, and optionally updates the project board.
|
|
90
|
+
|
|
91
|
+
### Planning
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { startPlanning, completePlanning } from '@happyvertical/github-actions';
|
|
95
|
+
|
|
96
|
+
// Generate an AI implementation plan and post it as a comment
|
|
97
|
+
const planResult = await startPlanning(context);
|
|
98
|
+
|
|
99
|
+
// Validate Definition of Ready and move to Ready status
|
|
100
|
+
const completeResult = await completePlanning(context);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Label Management
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import {
|
|
107
|
+
getAllStandardLabels,
|
|
108
|
+
getLabelsByCategory,
|
|
109
|
+
migrateLabel,
|
|
110
|
+
} from '@happyvertical/github-actions';
|
|
111
|
+
|
|
112
|
+
const allLabels = getAllStandardLabels(); // type, priority, size, status, agent
|
|
113
|
+
const bugLabels = getLabelsByCategory('type');
|
|
114
|
+
const newName = migrateLabel('enhancement'); // ā 'type: feature'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Shared Utilities
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import {
|
|
121
|
+
createRepository,
|
|
122
|
+
createProject,
|
|
123
|
+
getAICompletion,
|
|
124
|
+
parseAIJson,
|
|
125
|
+
} from '@happyvertical/github-actions';
|
|
126
|
+
|
|
127
|
+
// Adapter factories for @happyvertical/repos and @happyvertical/projects
|
|
128
|
+
const repo = await createRepository(token, 'happyvertical', 'sdk');
|
|
129
|
+
const project = await createProject(token, projectId, statusFieldId, statusOptions);
|
|
130
|
+
|
|
131
|
+
// AI completion with auto-provider selection (GitHub Models ā OpenAI ā Anthropic)
|
|
132
|
+
const response = await getAICompletion([
|
|
133
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
134
|
+
{ role: 'user', content: 'Analyze this issue...' },
|
|
135
|
+
]);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Architecture
|
|
139
|
+
|
|
140
|
+
- **`triage/`** ā Issue triage: AI analysis, labeling, duplicate detection, project board updates
|
|
141
|
+
- **`planning/`** ā Implementation planning: AI plan generation, Definition of Ready validation
|
|
142
|
+
- **`shared/`** ā AI client (GitHub Models, OpenAI, Anthropic), GitHub API helpers, label definitions, project utilities, adapter factories
|
|
143
|
+
- **`cli.ts`** ā CLI entry point (`triage`, `labels` commands)
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-context.d.ts","sourceRoot":"","sources":["../../src/cli/claude-context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, mkdirSync, copyFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const pkgRoot = join(__dirname$1, "../..");
|
|
7
|
+
const targetDir = join(process.cwd(), ".claude");
|
|
8
|
+
if (!existsSync(targetDir)) {
|
|
9
|
+
mkdirSync(targetDir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
const pkgName = "github-actions";
|
|
12
|
+
const agentMdSrc = existsSync(join(pkgRoot, "AGENT.md")) ? join(pkgRoot, "AGENT.md") : join(pkgRoot, "CLAUDE.md");
|
|
13
|
+
const metaSrc = existsSync(join(pkgRoot, "metadata.json")) ? join(pkgRoot, "metadata.json") : join(pkgRoot, ".claude-meta.json");
|
|
14
|
+
if (existsSync(agentMdSrc)) {
|
|
15
|
+
copyFileSync(agentMdSrc, join(targetDir, `have-${pkgName}.md`));
|
|
16
|
+
}
|
|
17
|
+
if (existsSync(metaSrc)) {
|
|
18
|
+
copyFileSync(metaSrc, join(targetDir, `have-${pkgName}.meta.json`));
|
|
19
|
+
}
|
|
20
|
+
console.log(`ā Installed @happyvertical/${pkgName} context to .claude/`);
|
|
21
|
+
//# sourceMappingURL=claude-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-context.js","sources":["../../src/cli/claude-context.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * CLI script to install agent context for @happyvertical/github-actions\n * Run the published context installer binary for this package.\n */\nimport { copyFileSync, existsSync, mkdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pkgRoot = join(__dirname, '../..');\nconst targetDir = join(process.cwd(), '.claude');\n\nif (!existsSync(targetDir)) {\n mkdirSync(targetDir, { recursive: true });\n}\n\nconst pkgName = 'github-actions';\nconst agentMdSrc = existsSync(join(pkgRoot, 'AGENT.md'))\n ? join(pkgRoot, 'AGENT.md')\n : join(pkgRoot, 'CLAUDE.md');\nconst metaSrc = existsSync(join(pkgRoot, 'metadata.json'))\n ? join(pkgRoot, 'metadata.json')\n : join(pkgRoot, '.claude-meta.json');\n\nif (existsSync(agentMdSrc)) {\n copyFileSync(agentMdSrc, join(targetDir, `have-${pkgName}.md`));\n}\n\nif (existsSync(metaSrc)) {\n copyFileSync(metaSrc, join(targetDir, `have-${pkgName}.meta.json`));\n}\n\nconsole.log(`ā Installed @happyvertical/${pkgName} context to .claude/`);\n"],"names":["__dirname"],"mappings":";;;;AASA,MAAMA,cAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,MAAM,UAAU,KAAKA,aAAW,OAAO;AACvC,MAAM,YAAY,KAAK,QAAQ,IAAA,GAAO,SAAS;AAE/C,IAAI,CAAC,WAAW,SAAS,GAAG;AAC1B,YAAU,WAAW,EAAE,WAAW,KAAA,CAAM;AAC1C;AAEA,MAAM,UAAU;AAChB,MAAM,aAAa,WAAW,KAAK,SAAS,UAAU,CAAC,IACnD,KAAK,SAAS,UAAU,IACxB,KAAK,SAAS,WAAW;AAC7B,MAAM,UAAU,WAAW,KAAK,SAAS,eAAe,CAAC,IACrD,KAAK,SAAS,eAAe,IAC7B,KAAK,SAAS,mBAAmB;AAErC,IAAI,WAAW,UAAU,GAAG;AAC1B,eAAa,YAAY,KAAK,WAAW,QAAQ,OAAO,KAAK,CAAC;AAChE;AAEA,IAAI,WAAW,OAAO,GAAG;AACvB,eAAa,SAAS,KAAK,WAAW,QAAQ,OAAO,YAAY,CAAC;AACpE;AAEA,QAAQ,IAAI,8BAA8B,OAAO,sBAAsB;"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI Interface for GitHub Actions
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* github-actions triage
|
|
7
|
+
*
|
|
8
|
+
* Environment Variables:
|
|
9
|
+
* GITHUB_TOKEN - GitHub authentication token
|
|
10
|
+
* GITHUB_REPOSITORY - Repository (owner/repo)
|
|
11
|
+
* ISSUE_NUMBER - Issue number to triage
|
|
12
|
+
* ISSUE_TITLE - Issue title
|
|
13
|
+
* ISSUE_BODY - Issue body (optional)
|
|
14
|
+
* ISSUE_AUTHOR - Issue author username
|
|
15
|
+
* CONFIG - JSON config string or file path (optional)
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import "@happyvertical/projects";
|
|
4
|
+
import { getRepository } from "@happyvertical/repos";
|
|
5
|
+
import "node:https";
|
|
6
|
+
import { l as getAllStandardLabels, A as AREA_LABEL_TEMPLATE, v as triageIssue } from "./index-v2-CqFKwTm8.js";
|
|
7
|
+
async function applyStandardLabels(options) {
|
|
8
|
+
console.log(
|
|
9
|
+
`
|
|
10
|
+
š·ļø Applying standard labels to ${options.owner}/${options.repo}`
|
|
11
|
+
);
|
|
12
|
+
if (options.dryRun) {
|
|
13
|
+
console.log("š DRY RUN MODE - No changes will be made\n");
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const repo = await getRepository({
|
|
17
|
+
type: "github",
|
|
18
|
+
owner: options.owner,
|
|
19
|
+
repo: options.repo,
|
|
20
|
+
token: options.token
|
|
21
|
+
});
|
|
22
|
+
const standardLabels = getAllStandardLabels();
|
|
23
|
+
const labelsToApply = [...standardLabels];
|
|
24
|
+
if (options.includeArea) {
|
|
25
|
+
const areaLabels = options.areaLabels ? options.areaLabels.map((name) => ({
|
|
26
|
+
name: `area: ${name}`,
|
|
27
|
+
color: "fbca04",
|
|
28
|
+
description: `${name.charAt(0).toUpperCase() + name.slice(1)} area`
|
|
29
|
+
})) : AREA_LABEL_TEMPLATE;
|
|
30
|
+
labelsToApply.push(...areaLabels);
|
|
31
|
+
}
|
|
32
|
+
console.log(`š Found ${labelsToApply.length} labels to create/update:
|
|
33
|
+
`);
|
|
34
|
+
const byCategory = {};
|
|
35
|
+
for (const label of labelsToApply) {
|
|
36
|
+
const category = label.name.split(":")[0];
|
|
37
|
+
if (!byCategory[category]) {
|
|
38
|
+
byCategory[category] = [];
|
|
39
|
+
}
|
|
40
|
+
byCategory[category].push(label);
|
|
41
|
+
}
|
|
42
|
+
for (const [category, labels] of Object.entries(byCategory)) {
|
|
43
|
+
console.log(` ${category}:`);
|
|
44
|
+
for (const label of labels) {
|
|
45
|
+
console.log(
|
|
46
|
+
` - ${label.name} (#${label.color}) - ${label.description}`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (options.dryRun) {
|
|
51
|
+
console.log("\nā
Dry run complete - no changes made");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
console.log("\nš§ Creating/updating labels...\n");
|
|
55
|
+
let created = 0;
|
|
56
|
+
let updated = 0;
|
|
57
|
+
let errors = 0;
|
|
58
|
+
for (const label of labelsToApply) {
|
|
59
|
+
try {
|
|
60
|
+
const existingLabels = await repo.listLabels();
|
|
61
|
+
const existing = existingLabels.find((l) => l.name === label.name);
|
|
62
|
+
if (existing) {
|
|
63
|
+
await repo.updateLabel(label.name, {
|
|
64
|
+
name: label.name,
|
|
65
|
+
color: label.color,
|
|
66
|
+
description: label.description
|
|
67
|
+
});
|
|
68
|
+
console.log(` ā
Updated: ${label.name}`);
|
|
69
|
+
updated++;
|
|
70
|
+
} else {
|
|
71
|
+
await repo.createLabel({
|
|
72
|
+
name: label.name,
|
|
73
|
+
color: label.color,
|
|
74
|
+
description: label.description
|
|
75
|
+
});
|
|
76
|
+
console.log(` ⨠Created: ${label.name}`);
|
|
77
|
+
created++;
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(
|
|
81
|
+
` ā Error with ${label.name}: ${error.message}`
|
|
82
|
+
);
|
|
83
|
+
errors++;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
console.log(`
|
|
87
|
+
ā
Label sync complete!`);
|
|
88
|
+
console.log(` Created: ${created}`);
|
|
89
|
+
console.log(` Updated: ${updated}`);
|
|
90
|
+
if (errors > 0) {
|
|
91
|
+
console.log(` Errors: ${errors}`);
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error("ā Failed to apply labels:", error.message);
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function main$1() {
|
|
99
|
+
const args = process.argv.slice(2);
|
|
100
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
101
|
+
console.log(`
|
|
102
|
+
Label Management CLI
|
|
103
|
+
|
|
104
|
+
Usage: github-actions labels [options]
|
|
105
|
+
|
|
106
|
+
Options:
|
|
107
|
+
--token <token> GitHub token (or GITHUB_TOKEN env var)
|
|
108
|
+
--owner <owner> Repository owner
|
|
109
|
+
--repo <repo> Repository name
|
|
110
|
+
--dry-run Preview changes without applying
|
|
111
|
+
--include-area Include area labels
|
|
112
|
+
--area <label> Custom area label (can be used multiple times)
|
|
113
|
+
-h, --help Show this help message
|
|
114
|
+
|
|
115
|
+
Examples:
|
|
116
|
+
# Dry run
|
|
117
|
+
github-actions labels --owner happyvertical --repo sdk --dry-run
|
|
118
|
+
|
|
119
|
+
# Apply standard labels
|
|
120
|
+
github-actions labels --owner happyvertical --repo sdk
|
|
121
|
+
|
|
122
|
+
# Apply with custom area labels
|
|
123
|
+
github-actions labels --owner happyvertical --repo sdk --include-area --area core --area api --area ui
|
|
124
|
+
|
|
125
|
+
Environment Variables:
|
|
126
|
+
GITHUB_TOKEN GitHub personal access token
|
|
127
|
+
`);
|
|
128
|
+
process.exit(0);
|
|
129
|
+
}
|
|
130
|
+
const token = args[args.indexOf("--token") + 1] || process.env.GITHUB_TOKEN;
|
|
131
|
+
const owner = args[args.indexOf("--owner") + 1];
|
|
132
|
+
const repo = args[args.indexOf("--repo") + 1];
|
|
133
|
+
const dryRun = args.includes("--dry-run");
|
|
134
|
+
const includeArea = args.includes("--include-area");
|
|
135
|
+
const areaLabels = [];
|
|
136
|
+
let i = 0;
|
|
137
|
+
while ((i = args.indexOf("--area", i)) !== -1) {
|
|
138
|
+
areaLabels.push(args[i + 1]);
|
|
139
|
+
i++;
|
|
140
|
+
}
|
|
141
|
+
if (!token) {
|
|
142
|
+
console.error("ā Error: GitHub token is required");
|
|
143
|
+
console.error(" Use --token <token> or set GITHUB_TOKEN env var");
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
146
|
+
if (!owner || !repo) {
|
|
147
|
+
console.error("ā Error: --owner and --repo are required");
|
|
148
|
+
process.exit(1);
|
|
149
|
+
}
|
|
150
|
+
await applyStandardLabels({
|
|
151
|
+
token,
|
|
152
|
+
owner,
|
|
153
|
+
repo,
|
|
154
|
+
dryRun,
|
|
155
|
+
includeArea,
|
|
156
|
+
areaLabels: areaLabels.length > 0 ? areaLabels : void 0
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
160
|
+
main$1().catch((error) => {
|
|
161
|
+
console.error("Fatal error:", error);
|
|
162
|
+
process.exit(1);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
async function main() {
|
|
166
|
+
const command = process.argv[2];
|
|
167
|
+
if (!command || command === "--help" || command === "-h") {
|
|
168
|
+
showHelp();
|
|
169
|
+
process.exit(0);
|
|
170
|
+
}
|
|
171
|
+
if (command === "triage") {
|
|
172
|
+
await runTriage();
|
|
173
|
+
} else if (command === "labels") {
|
|
174
|
+
await runLabels();
|
|
175
|
+
} else {
|
|
176
|
+
console.error(`Unknown command: ${command}`);
|
|
177
|
+
showHelp();
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function runLabels() {
|
|
182
|
+
const args = process.argv.slice(3);
|
|
183
|
+
const token = args[args.indexOf("--token") + 1] || process.env.GITHUB_TOKEN;
|
|
184
|
+
const owner = args[args.indexOf("--owner") + 1];
|
|
185
|
+
const repo = args[args.indexOf("--repo") + 1];
|
|
186
|
+
const dryRun = args.includes("--dry-run");
|
|
187
|
+
const includeArea = args.includes("--include-area");
|
|
188
|
+
const areaLabels = [];
|
|
189
|
+
let i = 0;
|
|
190
|
+
while ((i = args.indexOf("--area", i)) !== -1) {
|
|
191
|
+
areaLabels.push(args[i + 1]);
|
|
192
|
+
i++;
|
|
193
|
+
}
|
|
194
|
+
if (!token) {
|
|
195
|
+
console.error("ā Error: GitHub token is required");
|
|
196
|
+
console.error(" Use --token <token> or set GITHUB_TOKEN env var");
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
199
|
+
if (!owner || !repo) {
|
|
200
|
+
console.error("ā Error: --owner and --repo are required");
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
await applyStandardLabels({
|
|
204
|
+
token,
|
|
205
|
+
owner,
|
|
206
|
+
repo,
|
|
207
|
+
dryRun,
|
|
208
|
+
includeArea,
|
|
209
|
+
areaLabels: areaLabels.length > 0 ? areaLabels : void 0
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
async function runTriage() {
|
|
213
|
+
const token = process.env.GITHUB_TOKEN;
|
|
214
|
+
const repository = process.env.GITHUB_REPOSITORY;
|
|
215
|
+
const issueNumber = process.env.ISSUE_NUMBER;
|
|
216
|
+
const issueTitle = process.env.ISSUE_TITLE;
|
|
217
|
+
const issueBody = process.env.ISSUE_BODY;
|
|
218
|
+
const issueAuthor = process.env.ISSUE_AUTHOR;
|
|
219
|
+
if (!token || !repository || !issueNumber || !issueTitle || !issueAuthor) {
|
|
220
|
+
console.error("Missing required environment variables:");
|
|
221
|
+
console.error(" GITHUB_TOKEN");
|
|
222
|
+
console.error(" GITHUB_REPOSITORY");
|
|
223
|
+
console.error(" ISSUE_NUMBER");
|
|
224
|
+
console.error(" ISSUE_TITLE");
|
|
225
|
+
console.error(" ISSUE_AUTHOR");
|
|
226
|
+
process.exit(1);
|
|
227
|
+
}
|
|
228
|
+
const [owner, repo] = repository.split("/");
|
|
229
|
+
const config = loadConfig();
|
|
230
|
+
const context = {
|
|
231
|
+
token,
|
|
232
|
+
owner,
|
|
233
|
+
repo,
|
|
234
|
+
issueNumber: parseInt(issueNumber, 10),
|
|
235
|
+
issueTitle,
|
|
236
|
+
issueBody,
|
|
237
|
+
issueAuthor,
|
|
238
|
+
config
|
|
239
|
+
};
|
|
240
|
+
const result = await triageIssue(context);
|
|
241
|
+
if (!result.success) {
|
|
242
|
+
console.error("Triage failed");
|
|
243
|
+
process.exit(1);
|
|
244
|
+
}
|
|
245
|
+
console.log("Triage successful");
|
|
246
|
+
process.exit(0);
|
|
247
|
+
}
|
|
248
|
+
function loadConfig() {
|
|
249
|
+
const configEnv = process.env.CONFIG;
|
|
250
|
+
if (!configEnv) {
|
|
251
|
+
return {
|
|
252
|
+
repoDescription: "GitHub repository"
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
try {
|
|
256
|
+
return JSON.parse(configEnv);
|
|
257
|
+
} catch {
|
|
258
|
+
try {
|
|
259
|
+
const configFile = readFileSync(configEnv, "utf-8");
|
|
260
|
+
return JSON.parse(configFile);
|
|
261
|
+
} catch (error) {
|
|
262
|
+
console.error("Error loading config:", error.message);
|
|
263
|
+
return {
|
|
264
|
+
repoDescription: "GitHub repository"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function showHelp() {
|
|
270
|
+
console.log(`
|
|
271
|
+
@happyvertical/github-actions CLI
|
|
272
|
+
|
|
273
|
+
Usage:
|
|
274
|
+
github-actions <command> [options]
|
|
275
|
+
|
|
276
|
+
Commands:
|
|
277
|
+
triage Run AI-powered issue triage
|
|
278
|
+
labels Apply standard labels to repository
|
|
279
|
+
|
|
280
|
+
Environment Variables:
|
|
281
|
+
GITHUB_TOKEN GitHub authentication token (required)
|
|
282
|
+
GITHUB_REPOSITORY Repository in owner/repo format (required)
|
|
283
|
+
ISSUE_NUMBER Issue number to triage (required)
|
|
284
|
+
ISSUE_TITLE Issue title (required)
|
|
285
|
+
ISSUE_BODY Issue body (optional)
|
|
286
|
+
ISSUE_AUTHOR Issue author username (required)
|
|
287
|
+
CONFIG JSON config string or file path (optional)
|
|
288
|
+
|
|
289
|
+
Config Format:
|
|
290
|
+
{
|
|
291
|
+
"repoDescription": "Repository description for AI",
|
|
292
|
+
"packagePattern": "@happyvertical/*",
|
|
293
|
+
"packageExamples": ["@happyvertical/ai", "@happyvertical/sql"],
|
|
294
|
+
"projectEnabled": true,
|
|
295
|
+
"projectId": "PVT_xxx",
|
|
296
|
+
"statusFieldId": "PVTSSF_xxx",
|
|
297
|
+
"statusOptions": {
|
|
298
|
+
"To Do": "option_id_1",
|
|
299
|
+
"In Progress": "option_id_2"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
Examples:
|
|
304
|
+
# Basic triage with environment variables
|
|
305
|
+
export GITHUB_TOKEN="ghp_xxx"
|
|
306
|
+
export GITHUB_REPOSITORY="owner/repo"
|
|
307
|
+
export ISSUE_NUMBER="123"
|
|
308
|
+
export ISSUE_TITLE="Bug report"
|
|
309
|
+
export ISSUE_AUTHOR="username"
|
|
310
|
+
github-actions triage
|
|
311
|
+
|
|
312
|
+
# Triage with config file
|
|
313
|
+
export CONFIG=".github/triage-config.json"
|
|
314
|
+
github-actions triage
|
|
315
|
+
|
|
316
|
+
# Triage with inline config
|
|
317
|
+
export CONFIG='{"repoDescription":"My project","packagePattern":"@myorg/*"}'
|
|
318
|
+
github-actions triage
|
|
319
|
+
`);
|
|
320
|
+
}
|
|
321
|
+
main().catch((error) => {
|
|
322
|
+
console.error("Fatal error:", error);
|
|
323
|
+
process.exit(1);
|
|
324
|
+
});
|
|
325
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../src/labels-cli.ts","../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Label Management CLI\n *\n * Apply standard labels across repositories\n */\n\nimport { getRepository } from '@happyvertical/repos';\nimport {\n AREA_LABEL_TEMPLATE,\n getAllStandardLabels,\n type LabelDefinition,\n} from './shared/labels.js';\n\ninterface CliOptions {\n token: string;\n owner: string;\n repo: string;\n dryRun?: boolean;\n includeArea?: boolean;\n areaLabels?: string[];\n}\n\n/**\n * Apply standard labels to a repository\n */\nexport async function applyStandardLabels(options: CliOptions): Promise<void> {\n console.log(\n `\\nš·ļø Applying standard labels to ${options.owner}/${options.repo}`,\n );\n\n if (options.dryRun) {\n console.log('š DRY RUN MODE - No changes will be made\\n');\n }\n\n try {\n const repo = await getRepository({\n type: 'github',\n owner: options.owner,\n repo: options.repo,\n token: options.token,\n });\n\n // Get standard labels\n const standardLabels = getAllStandardLabels();\n\n // Add area labels if requested\n const labelsToApply: LabelDefinition[] = [...standardLabels];\n\n if (options.includeArea) {\n const areaLabels = options.areaLabels\n ? options.areaLabels.map((name) => ({\n name: `area: ${name}`,\n color: 'fbca04',\n description: `${name.charAt(0).toUpperCase() + name.slice(1)} area`,\n }))\n : AREA_LABEL_TEMPLATE;\n\n labelsToApply.push(...areaLabels);\n }\n\n console.log(`š Found ${labelsToApply.length} labels to create/update:\\n`);\n\n // Group by category for display\n const byCategory: Record<string, LabelDefinition[]> = {};\n for (const label of labelsToApply) {\n const category = label.name.split(':')[0];\n if (!byCategory[category]) {\n byCategory[category] = [];\n }\n byCategory[category].push(label);\n }\n\n for (const [category, labels] of Object.entries(byCategory)) {\n console.log(` ${category}:`);\n for (const label of labels) {\n console.log(\n ` - ${label.name} (#${label.color}) - ${label.description}`,\n );\n }\n }\n\n if (options.dryRun) {\n console.log('\\nā
Dry run complete - no changes made');\n return;\n }\n\n // Apply labels\n console.log('\\nš§ Creating/updating labels...\\n');\n\n let created = 0;\n let updated = 0;\n let errors = 0;\n\n for (const label of labelsToApply) {\n try {\n // Try to update first\n const existingLabels = await repo.listLabels();\n const existing = existingLabels.find((l) => l.name === label.name);\n\n if (existing) {\n await repo.updateLabel(label.name, {\n name: label.name,\n color: label.color,\n description: label.description,\n });\n console.log(` ā
Updated: ${label.name}`);\n updated++;\n } else {\n await repo.createLabel({\n name: label.name,\n color: label.color,\n description: label.description,\n });\n console.log(` ⨠Created: ${label.name}`);\n created++;\n }\n } catch (error) {\n console.error(\n ` ā Error with ${label.name}: ${(error as Error).message}`,\n );\n errors++;\n }\n }\n\n console.log(`\\nā
Label sync complete!`);\n console.log(` Created: ${created}`);\n console.log(` Updated: ${updated}`);\n if (errors > 0) {\n console.log(` Errors: ${errors}`);\n }\n } catch (error) {\n console.error('ā Failed to apply labels:', (error as Error).message);\n throw error;\n }\n}\n\n/**\n * CLI entry point\n */\nasync function main() {\n const args = process.argv.slice(2);\n\n if (args.includes('--help') || args.includes('-h')) {\n console.log(`\nLabel Management CLI\n\nUsage: github-actions labels [options]\n\nOptions:\n --token <token> GitHub token (or GITHUB_TOKEN env var)\n --owner <owner> Repository owner\n --repo <repo> Repository name\n --dry-run Preview changes without applying\n --include-area Include area labels\n --area <label> Custom area label (can be used multiple times)\n -h, --help Show this help message\n\nExamples:\n # Dry run\n github-actions labels --owner happyvertical --repo sdk --dry-run\n\n # Apply standard labels\n github-actions labels --owner happyvertical --repo sdk\n\n # Apply with custom area labels\n github-actions labels --owner happyvertical --repo sdk --include-area --area core --area api --area ui\n\nEnvironment Variables:\n GITHUB_TOKEN GitHub personal access token\n`);\n process.exit(0);\n }\n\n const token = args[args.indexOf('--token') + 1] || process.env.GITHUB_TOKEN;\n const owner = args[args.indexOf('--owner') + 1];\n const repo = args[args.indexOf('--repo') + 1];\n const dryRun = args.includes('--dry-run');\n const includeArea = args.includes('--include-area');\n\n // Parse custom area labels\n const areaLabels: string[] = [];\n let i = 0;\n while ((i = args.indexOf('--area', i)) !== -1) {\n areaLabels.push(args[i + 1]);\n i++;\n }\n\n if (!token) {\n console.error('ā Error: GitHub token is required');\n console.error(' Use --token <token> or set GITHUB_TOKEN env var');\n process.exit(1);\n }\n\n if (!owner || !repo) {\n console.error('ā Error: --owner and --repo are required');\n process.exit(1);\n }\n\n await applyStandardLabels({\n token,\n owner,\n repo,\n dryRun,\n includeArea,\n areaLabels: areaLabels.length > 0 ? areaLabels : undefined,\n });\n}\n\n// Run if called directly\nif (import.meta.url === `file://${process.argv[1]}`) {\n main().catch((error) => {\n console.error('Fatal error:', error);\n process.exit(1);\n });\n}\n","#!/usr/bin/env node\n\n/**\n * CLI Interface for GitHub Actions\n *\n * Usage:\n * github-actions triage\n *\n * Environment Variables:\n * GITHUB_TOKEN - GitHub authentication token\n * GITHUB_REPOSITORY - Repository (owner/repo)\n * ISSUE_NUMBER - Issue number to triage\n * ISSUE_TITLE - Issue title\n * ISSUE_BODY - Issue body (optional)\n * ISSUE_AUTHOR - Issue author username\n * CONFIG - JSON config string or file path (optional)\n */\n\nimport { readFileSync } from 'node:fs';\nimport { type TriageConfig, type TriageContext, triageIssue } from './index.js';\nimport { applyStandardLabels } from './labels-cli.js';\n\nasync function main() {\n const command = process.argv[2];\n\n if (!command || command === '--help' || command === '-h') {\n showHelp();\n process.exit(0);\n }\n\n if (command === 'triage') {\n await runTriage();\n } else if (command === 'labels') {\n await runLabels();\n } else {\n console.error(`Unknown command: ${command}`);\n showHelp();\n process.exit(1);\n }\n}\n\nasync function runLabels() {\n const args = process.argv.slice(3);\n const token = args[args.indexOf('--token') + 1] || process.env.GITHUB_TOKEN;\n const owner = args[args.indexOf('--owner') + 1];\n const repo = args[args.indexOf('--repo') + 1];\n const dryRun = args.includes('--dry-run');\n const includeArea = args.includes('--include-area');\n\n // Parse custom area labels\n const areaLabels: string[] = [];\n let i = 0;\n while ((i = args.indexOf('--area', i)) !== -1) {\n areaLabels.push(args[i + 1]);\n i++;\n }\n\n if (!token) {\n console.error('ā Error: GitHub token is required');\n console.error(' Use --token <token> or set GITHUB_TOKEN env var');\n process.exit(1);\n }\n\n if (!owner || !repo) {\n console.error('ā Error: --owner and --repo are required');\n process.exit(1);\n }\n\n await applyStandardLabels({\n token,\n owner,\n repo,\n dryRun,\n includeArea,\n areaLabels: areaLabels.length > 0 ? areaLabels : undefined,\n });\n}\n\nasync function runTriage() {\n // Get required environment variables\n const token = process.env.GITHUB_TOKEN;\n const repository = process.env.GITHUB_REPOSITORY;\n const issueNumber = process.env.ISSUE_NUMBER;\n const issueTitle = process.env.ISSUE_TITLE;\n const issueBody = process.env.ISSUE_BODY;\n const issueAuthor = process.env.ISSUE_AUTHOR;\n\n if (!token || !repository || !issueNumber || !issueTitle || !issueAuthor) {\n console.error('Missing required environment variables:');\n console.error(' GITHUB_TOKEN');\n console.error(' GITHUB_REPOSITORY');\n console.error(' ISSUE_NUMBER');\n console.error(' ISSUE_TITLE');\n console.error(' ISSUE_AUTHOR');\n process.exit(1);\n }\n\n const [owner, repo] = repository.split('/');\n\n // Load configuration\n const config = loadConfig();\n\n // Build context\n const context: TriageContext = {\n token,\n owner,\n repo,\n issueNumber: parseInt(issueNumber, 10),\n issueTitle,\n issueBody,\n issueAuthor,\n config,\n };\n\n // Run triage\n const result = await triageIssue(context);\n\n if (!result.success) {\n console.error('Triage failed');\n process.exit(1);\n }\n\n console.log('Triage successful');\n process.exit(0);\n}\n\nfunction loadConfig(): TriageConfig {\n const configEnv = process.env.CONFIG;\n\n if (!configEnv) {\n // Default config\n return {\n repoDescription: 'GitHub repository',\n };\n }\n\n try {\n // Try to parse as JSON\n return JSON.parse(configEnv) as TriageConfig;\n } catch {\n // Try to read as file path\n try {\n const configFile = readFileSync(configEnv, 'utf-8');\n return JSON.parse(configFile) as TriageConfig;\n } catch (error) {\n console.error('Error loading config:', (error as Error).message);\n return {\n repoDescription: 'GitHub repository',\n };\n }\n }\n}\n\nfunction showHelp() {\n console.log(`\n@happyvertical/github-actions CLI\n\nUsage:\n github-actions <command> [options]\n\nCommands:\n triage Run AI-powered issue triage\n labels Apply standard labels to repository\n\nEnvironment Variables:\n GITHUB_TOKEN GitHub authentication token (required)\n GITHUB_REPOSITORY Repository in owner/repo format (required)\n ISSUE_NUMBER Issue number to triage (required)\n ISSUE_TITLE Issue title (required)\n ISSUE_BODY Issue body (optional)\n ISSUE_AUTHOR Issue author username (required)\n CONFIG JSON config string or file path (optional)\n\nConfig Format:\n {\n \"repoDescription\": \"Repository description for AI\",\n \"packagePattern\": \"@happyvertical/*\",\n \"packageExamples\": [\"@happyvertical/ai\", \"@happyvertical/sql\"],\n \"projectEnabled\": true,\n \"projectId\": \"PVT_xxx\",\n \"statusFieldId\": \"PVTSSF_xxx\",\n \"statusOptions\": {\n \"To Do\": \"option_id_1\",\n \"In Progress\": \"option_id_2\"\n }\n }\n\nExamples:\n # Basic triage with environment variables\n export GITHUB_TOKEN=\"ghp_xxx\"\n export GITHUB_REPOSITORY=\"owner/repo\"\n export ISSUE_NUMBER=\"123\"\n export ISSUE_TITLE=\"Bug report\"\n export ISSUE_AUTHOR=\"username\"\n github-actions triage\n\n # Triage with config file\n export CONFIG=\".github/triage-config.json\"\n github-actions triage\n\n # Triage with inline config\n export CONFIG='{\"repoDescription\":\"My project\",\"packagePattern\":\"@myorg/*\"}'\n github-actions triage\n`);\n}\n\nmain().catch((error) => {\n console.error('Fatal error:', error);\n process.exit(1);\n});\n"],"names":["main"],"mappings":";;;;;;AA0BA,eAAsB,oBAAoB,SAAoC;AAC5E,UAAQ;AAAA,IACN;AAAA,mCAAsC,QAAQ,KAAK,IAAI,QAAQ,IAAI;AAAA,EAAA;AAGrE,MAAI,QAAQ,QAAQ;AAClB,YAAQ,IAAI,6CAA6C;AAAA,EAC3D;AAEA,MAAI;AACF,UAAM,OAAO,MAAM,cAAc;AAAA,MAC/B,MAAM;AAAA,MACN,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ;AAAA,MACd,OAAO,QAAQ;AAAA,IAAA,CAChB;AAGD,UAAM,iBAAiB,qBAAA;AAGvB,UAAM,gBAAmC,CAAC,GAAG,cAAc;AAE3D,QAAI,QAAQ,aAAa;AACvB,YAAM,aAAa,QAAQ,aACvB,QAAQ,WAAW,IAAI,CAAC,UAAU;AAAA,QAChC,MAAM,SAAS,IAAI;AAAA,QACnB,OAAO;AAAA,QACP,aAAa,GAAG,KAAK,OAAO,CAAC,EAAE,YAAA,IAAgB,KAAK,MAAM,CAAC,CAAC;AAAA,MAAA,EAC5D,IACF;AAEJ,oBAAc,KAAK,GAAG,UAAU;AAAA,IAClC;AAEA,YAAQ,IAAI,YAAY,cAAc,MAAM;AAAA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