Add label trigger functionality to Claude Code Action (#177)

- introduced a new input parameter `label_trigger` in `action.yml` to allow triggering actions based on specific labels applied to issues.
- Enhanced the context preparation and event handling in the code to support the new labled event.
This commit is contained in:
Tomohiro Ishibashi
2025-06-26 02:25:26 +09:00
committed by GitHub
parent c831be8f54
commit b0d9b8c4cd
10 changed files with 182 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ export type ParsedGitHubContext = {
inputs: {
triggerPhrase: string;
assigneeTrigger: string;
labelTrigger: string;
allowedTools: string[];
disallowedTools: string[];
customInstructions: string;
@@ -53,6 +54,7 @@ export function parseGitHubContext(): ParsedGitHubContext {
inputs: {
triggerPhrase: process.env.TRIGGER_PHRASE ?? "@claude",
assigneeTrigger: process.env.ASSIGNEE_TRIGGER ?? "",
labelTrigger: process.env.LABEL_TRIGGER ?? "",
allowedTools: parseMultilineInput(process.env.ALLOWED_TOOLS ?? ""),
disallowedTools: parseMultilineInput(process.env.DISALLOWED_TOOLS ?? ""),
customInstructions: process.env.CUSTOM_INSTRUCTIONS ?? "",