Skip to content

Commit a28b951

Browse files
jason-rlclaude
andcommitted
Add webhooks support and rename custom-skill to skills
- Rename custom-skill input to skills (accepts YAML list) - Add webhooks input for agent event notifications - Send custom_skills and webhooks for all source types (was NPM-only) - Extract buildOptionalFields helper to reduce duplication Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a095cee commit a28b951

5 files changed

Lines changed: 60 additions & 15 deletions

File tree

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ inputs:
5656
description: 'Path to file or tar archive (required if source-type=tar/file)'
5757
required: false
5858

59-
# Custom skill inputs
60-
custom-skill:
61-
description: 'YAML-encoded custom skill definition to attach to the agent'
59+
# Skills inputs
60+
skills:
61+
description: 'YAML-encoded list of custom skill definitions to attach to the agent'
62+
required: false
63+
64+
# Webhook inputs
65+
webhooks:
66+
description: 'YAML-encoded list of webhook configurations (url, events, secret)'
6267
required: false
6368

6469
# Common inputs

dist/index.js

Lines changed: 24 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent-deployer.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ export async function deployAgent(inputs: ActionInputs): Promise<DeploymentResul
7171
return result;
7272
}
7373

74+
/**
75+
* Build optional fields (custom_skills, webhooks) shared across all deploy functions.
76+
*/
77+
function buildOptionalFields(inputs: ActionInputs): Record<string, unknown> {
78+
const fields: Record<string, unknown> = {};
79+
if (inputs.skills && inputs.skills.length > 0) {
80+
fields.custom_skills = inputs.skills;
81+
}
82+
if (inputs.webhooks) {
83+
fields.webhooks = inputs.webhooks;
84+
}
85+
return fields;
86+
}
87+
7488
/**
7589
* Deploy an agent from a Git repository.
7690
*/
@@ -100,6 +114,7 @@ async function deployGitAgent(
100114
agent_setup: inputs.setupCommands || [],
101115
},
102116
},
117+
...buildOptionalFields(inputs),
103118
},
104119
});
105120

@@ -142,6 +157,7 @@ async function deployTarAgent(
142157
agent_setup: inputs.setupCommands || [],
143158
},
144159
},
160+
...buildOptionalFields(inputs),
145161
},
146162
});
147163

@@ -185,6 +201,7 @@ async function deployFileAgent(
185201
agent_setup: inputs.setupCommands || [],
186202
},
187203
},
204+
...buildOptionalFields(inputs),
188205
},
189206
});
190207

@@ -227,10 +244,8 @@ async function deployNpmAgent(
227244
type: 'npm',
228245
npm: npmSource,
229246
},
247+
...buildOptionalFields(inputs),
230248
};
231-
if (inputs.customSkill) {
232-
body.custom_skill = inputs.customSkill;
233-
}
234249

235250
const agent = await client.api.post<unknown, AgentResponse>('/v1/agents', {
236251
body,
@@ -275,6 +290,7 @@ async function deployPipAgent(
275290
type: 'pip',
276291
pip: pipSource,
277292
},
293+
...buildOptionalFields(inputs),
278294
},
279295
});
280296

src/validators.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export interface ActionInputs {
1616
pipPackage?: string;
1717
pipIndexUrl?: string;
1818
setupCommands?: string[];
19-
customSkill?: Record<string, unknown>;
19+
skills?: Array<Record<string, unknown>>;
20+
webhooks?: Array<{ url: string; events?: string[]; secret?: string }>;
2021
isPublic: boolean;
2122
apiUrl: string;
2223
objectTtlDays?: number;
@@ -28,7 +29,8 @@ export function getInputs(): ActionInputs {
2829
// Get all inputs
2930
const sourceType = core.getInput('source-type', { required: true }) as SourceType;
3031
const setupCommandsRaw = core.getInput('setup-commands');
31-
const customSkillRaw = core.getInput('custom-skill');
32+
const skillsRaw = core.getInput('skills');
33+
const webhooksRaw = core.getInput('webhooks');
3234
const isPublicRaw = core.getInput('is-public') || 'false';
3335
const objectTtlDaysRaw = core.getInput('object-ttl-days');
3436

@@ -50,7 +52,10 @@ export function getInputs(): ActionInputs {
5052
.map(cmd => cmd.trim())
5153
.filter(cmd => cmd.length > 0)
5254
: undefined,
53-
customSkill: customSkillRaw ? yaml.load(customSkillRaw) as Record<string, unknown> : undefined,
55+
skills: skillsRaw ? yaml.load(skillsRaw) as Array<Record<string, unknown>> : undefined,
56+
webhooks: webhooksRaw
57+
? yaml.load(webhooksRaw) as Array<{ url: string; events?: string[]; secret?: string }>
58+
: undefined,
5459
isPublic: isPublicRaw === 'true',
5560
apiUrl: core.getInput('api-url') || 'https://api.runloop.ai',
5661
objectTtlDays: objectTtlDaysRaw ? parseInt(objectTtlDaysRaw, 10) : undefined,

0 commit comments

Comments
 (0)