Skip to content

Commit da2a961

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 82ece36 commit da2a961

5 files changed

Lines changed: 76 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: 40 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
*/
@@ -101,6 +115,7 @@ async function deployGitAgent(
101115
agent_setup: inputs.setupCommands || [],
102116
},
103117
},
118+
...buildOptionalFields(inputs),
104119
},
105120
});
106121

@@ -144,6 +159,7 @@ async function deployTarAgent(
144159
agent_setup: inputs.setupCommands || [],
145160
},
146161
},
162+
...buildOptionalFields(inputs),
147163
},
148164
});
149165

@@ -188,6 +204,7 @@ async function deployFileAgent(
188204
agent_setup: inputs.setupCommands || [],
189205
},
190206
},
207+
...buildOptionalFields(inputs),
191208
},
192209
});
193210

@@ -231,10 +248,8 @@ async function deployNpmAgent(
231248
type: 'npm',
232249
npm: npmSource,
233250
},
251+
...buildOptionalFields(inputs),
234252
};
235-
if (inputs.customSkill) {
236-
body.custom_skill = inputs.customSkill;
237-
}
238253

239254
const agent = await client.api.post<unknown, AgentResponse>('/v1/agents', {
240255
body,
@@ -280,6 +295,7 @@ async function deployPipAgent(
280295
type: 'pip',
281296
pip: pipSource,
282297
},
298+
...buildOptionalFields(inputs),
283299
},
284300
});
285301

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;
@@ -29,7 +30,8 @@ export function getInputs(): ActionInputs {
2930
// Get all inputs
3031
const sourceType = core.getInput('source-type', { required: true }) as SourceType;
3132
const setupCommandsRaw = core.getInput('setup-commands');
32-
const customSkillRaw = core.getInput('custom-skill');
33+
const skillsRaw = core.getInput('skills');
34+
const webhooksRaw = core.getInput('webhooks');
3335
const isPublicRaw = core.getInput('is-public') || 'false';
3436
const objectTtlDaysRaw = core.getInput('object-ttl-days');
3537

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

0 commit comments

Comments
 (0)