{"id":"2ed92543-86db-4218-b94e-8400ecfc5e36","shortId":"7LqADm","kind":"skill","title":"create-trigger","tagline":"Generate Harness Trigger YAML for automated pipeline execution and create via MCP. Use when user says \"create trigger\", \"webhook trigger\", \"cron trigger\", \"scheduled build\", \"artifact trigger\", or wants pipelines to run automatically.","description":"# Create Trigger\n\nGenerate Harness Trigger YAML and push to Harness via MCP.\n\n## Instructions\n\n1. **Identify trigger type** - Webhook (Git events), Scheduled (cron), Artifact (registry updates), or Manifest (Helm chart updates)\n2. **Configure conditions** - Branch filters, payload conditions, cron expression, or artifact path\n3. **Generate YAML** using the templates below, referencing the target pipeline\n4. **Create via MCP** using `harness_create` with resource_type `trigger`\n5. **Verify webhook registration** - For webhook triggers, confirm the webhook is registered in the Git provider\n\n## Trigger Types\n\n- **Webhook** - GitHub, GitLab, Bitbucket, Azure Repos, Custom\n- **Scheduled** - Cron-based scheduling\n- **Artifact** - Docker Hub, ECR, GCR, ACR, Nexus\n- **Manifest** - Helm chart updates\n\n## Webhook Trigger (GitHub)\n\n```yaml\ntrigger:\n  name: PR Trigger\n  identifier: pr_trigger\n  orgIdentifier: default\n  projectIdentifier: my_project\n  pipelineIdentifier: ci_pipeline\n  source:\n    type: Webhook\n    spec:\n      type: Github\n      spec:\n        type: PullRequest\n        spec:\n          connectorRef: github_connector\n          autoAbortPreviousExecutions: true\n          payloadConditions:\n            - key: targetBranch\n              operator: Equals\n              value: main\n          headerConditions: []\n          jexlCondition: \"\"\n          actions:\n            - Open\n            - Reopen\n            - Synchronize\n  inputYaml: |\n    pipeline:\n      identifier: ci_pipeline\n      properties:\n        ci:\n          codebase:\n            build:\n              type: PR\n              spec:\n                number: <+trigger.prNumber>\n```\n\n### GitHub Event Types\n- `Push` - Code pushed to branch\n- `PullRequest` - PR events (Open, Close, Reopen, Synchronize, Edit)\n- `IssueComment` - PR comments (Create, Edit, Delete)\n- `Release` - Release events (Create, Publish, Edit)\n\n## Webhook Trigger (GitLab)\n\n```yaml\ntrigger:\n  name: GitLab Push\n  identifier: gitlab_push\n  pipelineIdentifier: ci_pipeline\n  source:\n    type: Webhook\n    spec:\n      type: Gitlab\n      spec:\n        type: Push\n        spec:\n          connectorRef: gitlab_connector\n          payloadConditions:\n            - key: ref\n              operator: Contains\n              value: main\n```\n\n## Scheduled (Cron) Trigger\n\n```yaml\ntrigger:\n  name: Nightly Build\n  identifier: nightly_build\n  orgIdentifier: default\n  projectIdentifier: my_project\n  pipelineIdentifier: ci_pipeline\n  source:\n    type: Scheduled\n    spec:\n      type: Cron\n      spec:\n        expression: \"0 2 * * *\"    # 2 AM daily\n  inputYaml: |\n    pipeline:\n      identifier: ci_pipeline\n      properties:\n        ci:\n          codebase:\n            build:\n              type: branch\n              spec:\n                branch: main\n```\n\nCron format: `<minute> <hour> <day-of-month> <month> <day-of-week>`\n\n## Artifact Trigger (Docker Registry)\n\n```yaml\ntrigger:\n  name: New Image Trigger\n  identifier: new_image\n  pipelineIdentifier: deploy_pipeline\n  source:\n    type: Artifact\n    spec:\n      type: DockerRegistry\n      spec:\n        connectorRef: dockerhub\n        imagePath: myorg/myimage\n        tag: <+trigger.artifact.build>\n  inputYaml: |\n    pipeline:\n      identifier: deploy_pipeline\n      stages:\n        - stage:\n            identifier: deploy\n            spec:\n              service:\n                serviceRef: my_service\n```\n\n### Artifact Source Types\n- `DockerRegistry` - Docker Hub\n- `Ecr` - AWS ECR\n- `Gcr` - Google Container Registry\n- `Acr` - Azure Container Registry\n- `Nexus3Registry` - Nexus\n- `AmazonS3` - S3 artifacts\n\n## Creating via MCP\n\n```\nCall MCP tool: harness_create\nParameters:\n  resource_type: \"trigger\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n  body: <trigger YAML>\n```\n\nTo list existing triggers:\n\n```\nCall MCP tool: harness_list\nParameters:\n  resource_type: \"trigger\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n```\n\n## Payload Conditions\n\nFilter triggers by webhook payload:\n\n```yaml\npayloadConditions:\n  - key: targetBranch\n    operator: Equals        # Equals, NotEquals, In, NotIn, StartsWith, EndsWith, Contains, Regex\n    value: main\n  - key: sourceBranch\n    operator: StartsWith\n    value: feature/\n```\n\nCommon keys: `sourceBranch`, `targetBranch`, `ref`, `action`, `tag`\n\n## Examples\n\n- \"Create a GitHub PR trigger for CI\" - Webhook trigger with PullRequest type\n- \"Set up nightly builds at 2 AM\" - Scheduled trigger with cron\n- \"Trigger deploy when new Docker image is pushed\" - Artifact trigger with DockerRegistry\n- \"Create a release trigger for tags\" - Webhook with Push type, tag filter\n\n## Performance Notes\n\n- Verify payload conditions match actual webhook payloads from the Git provider.\n- For cron triggers, double-check the expression — cron uses UTC timezone.\n- Confirm the target pipeline identifier and inputYaml match the pipeline's expected inputs.\n\n## Troubleshooting\n\n### Trigger Not Firing\n- Verify webhook is registered in Git provider\n- Check payload conditions match actual payload\n- Ensure connector has correct permissions\n- Test with `harness_get` on the trigger to verify config\n\n### Duplicate Executions\n- Enable `autoAbortPreviousExecutions` for PR triggers\n- Check for overlapping trigger conditions\n\n### Cron Not Running\n- Verify cron expression syntax (5 fields, UTC timezone)\n- Check pipeline identifier is correct\n- Ensure trigger is enabled","tags":["create","trigger","harness","skills","agent-skills","agents"],"capabilities":["skill","source-harness","skill-create-trigger","topic-agent-skills","topic-agents"],"categories":["harness-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/harness/harness-skills/create-trigger","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add harness/harness-skills","source_repo":"https://github.com/harness/harness-skills","install_from":"skills.sh"}},"qualityScore":"0.457","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 15 github stars · SKILL.md body (5,397 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:06:29.922Z","embedding":null,"createdAt":"2026-05-09T01:05:28.606Z","updatedAt":"2026-05-18T19:06:29.922Z","lastSeenAt":"2026-05-18T19:06:29.922Z","tsv":"'0':291 '1':49 '2':66,292,293,465 '3':78 '4':89 '5':100,584 'acr':135,368 'action':184,445 'actual':501,548 'amazons3':374 'artifact':28,58,76,130,312,330,355,376,479 'autoabortpreviousexecut':173,568 'autom':9 'automat':35 'aw':362 'azur':122,369 'base':128 'bitbucket':121 'bodi':393 'branch':69,209,306,308 'build':27,196,271,274,304,463 'call':380,398 'chart':64,139 'check':513,544,572,588 'ci':158,191,194,242,281,299,302,454 'close':214 'code':206 'codebas':195,303 'comment':220 'common':440 'condit':68,72,412,499,546,576 'config':564 'configur':67 'confirm':107,520 'connector':172,256,551 'connectorref':170,254,335 'contain':261,366,370,430 'correct':553,592 'creat':2,13,20,36,90,95,221,227,377,384,448,483 'create-trigg':1 'cron':24,57,73,127,265,288,310,470,509,516,577,581 'cron-bas':126 'custom':124 'daili':295 'default':153,276 'delet':223 'deploy':326,344,349,472 'docker':131,314,359,475 'dockerhub':336 'dockerregistri':333,358,482 'doubl':512 'double-check':511 'duplic':565 'ecr':133,361,363 'edit':217,222,229 'enabl':567,596 'endswith':429 'ensur':550,593 'equal':179,423,424 'event':55,203,212,226 'exampl':447 'execut':11,566 'exist':396 'expect':531 'express':74,290,515,582 'featur':439 'field':585 'filter':70,413,494 'fire':536 'format':311 'gcr':134,364 'generat':4,38,79 'get':558 'git':54,114,506,542 'github':119,143,165,171,202,450 'gitlab':120,232,236,239,249,255 'googl':365 'har':5,39,45,94,383,401,557 'headercondit':182 'helm':63,138 'hub':132,360 'id':390,392,408,410 'identifi':50,149,190,238,272,298,322,343,348,524,590 'imag':320,324,476 'imagepath':337 'input':532 'inputyaml':188,296,341,526 'instruct':48 'issuecom':218 'jexlcondit':183 'key':176,258,420,434,441 'list':395,402 'main':181,263,309,433 'manifest':62,137 'match':500,527,547 'mcp':15,47,92,379,381,399 'myorg/myimage':338 'name':146,235,269,318 'new':319,323,474 'nexus':136,373 'nexus3registry':372 'night':270,273,462 'note':496 'notequ':425 'notin':427 'number':200 'open':185,213 'oper':178,260,422,436 'org':389,407 'orgidentifi':152,275 'overlap':574 'paramet':385,403 'path':77 'payload':71,411,417,498,503,545,549 'payloadcondit':175,257,419 'perform':495 'permiss':554 'pipelin':10,32,88,159,189,192,243,282,297,300,327,342,345,523,529,589 'pipelineidentifi':157,241,280,325 'pr':147,150,198,211,219,451,570 'project':156,279,391,409 'projectidentifi':154,277 'properti':193,301 'provid':115,507,543 'publish':228 'pullrequest':168,210,458 'push':43,205,207,237,240,252,478,491 'ref':259,444 'referenc':85 'regex':431 'regist':111,540 'registr':103 'registri':59,315,367,371 'releas':224,225,485 'reopen':186,215 'repo':123 'resourc':97,386,404 'run':34,579 's3':375 'say':19 'schedul':26,56,125,129,264,285,467 'servic':351,354 'serviceref':352 'set':460 'skill' 'skill-create-trigger' 'sourc':160,244,283,328,356 'source-harness' 'sourcebranch':435,442 'spec':163,166,169,199,247,250,253,286,289,307,331,334,350 'stage':346,347 'startswith':428,437 'synchron':187,216 'syntax':583 'tag':339,446,488,493 'target':87,522 'targetbranch':177,421,443 'templat':83 'test':555 'timezon':519,587 'tool':382,400 'topic-agent-skills' 'topic-agents' 'trigger':3,6,21,23,25,29,37,40,51,99,106,116,142,145,148,151,231,234,266,268,313,317,321,388,397,406,414,452,456,468,471,480,486,510,534,561,571,575,594 'trigger.artifact.build':340 'trigger.prnumber':201 'troubleshoot':533 'true':174 'type':52,98,117,161,164,167,197,204,245,248,251,284,287,305,329,332,357,387,405,459,492 'updat':60,65,140 'use':16,81,93,517 'user':18 'utc':518,586 'valu':180,262,432,438 'verifi':101,497,537,563,580 'via':14,46,91,378 'want':31 'webhook':22,53,102,105,109,118,141,162,230,246,416,455,489,502,538 'yaml':7,41,80,144,233,267,316,418","prices":[{"id":"d5762727-7d00-4fb0-b909-a007f2e7ea55","listingId":"2ed92543-86db-4218-b94e-8400ecfc5e36","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"harness","category":"harness-skills","install_from":"skills.sh"},"createdAt":"2026-05-09T01:05:28.606Z"}],"sources":[{"listingId":"2ed92543-86db-4218-b94e-8400ecfc5e36","source":"github","sourceId":"harness/harness-skills/create-trigger","sourceUrl":"https://github.com/harness/harness-skills/tree/main/skills/create-trigger","isPrimary":false,"firstSeenAt":"2026-05-09T01:05:28.606Z","lastSeenAt":"2026-05-18T19:06:29.922Z"}],"details":{"listingId":"2ed92543-86db-4218-b94e-8400ecfc5e36","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"harness","slug":"create-trigger","github":{"repo":"harness/harness-skills","stars":15,"topics":["agent-skills","agents"],"license":"apache-2.0","html_url":"https://github.com/harness/harness-skills","pushed_at":"2026-05-13T01:28:28Z","description":"A collection of structured AI agent skills that   enable Claude Code, Cursor, GitHub Copilot, and   other AI coding assistants to create, operate,   debug, and govern Harness CI/CD workflows through   natural language.","skill_md_sha":"6aea54ce5cde181dbaa79cbb2329abfddd6e23ed","skill_md_path":"skills/create-trigger/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/harness/harness-skills/tree/main/skills/create-trigger"},"layout":"multi","source":"github","category":"harness-skills","frontmatter":{"name":"create-trigger","license":"Apache-2.0","description":"Generate Harness Trigger YAML for automated pipeline execution and create via MCP. Use when user says \"create trigger\", \"webhook trigger\", \"cron trigger\", \"scheduled build\", \"artifact trigger\", or wants pipelines to run automatically.","compatibility":"Requires Harness MCP v2 server (harness-mcp-v2)"},"skills_sh_url":"https://skills.sh/harness/harness-skills/create-trigger"},"updatedAt":"2026-05-18T19:06:29.922Z"}}