{"id":24615786,"url":"https://github.com/runreal/runtrigger","last_synced_at":"2026-04-29T14:02:43.507Z","repository":{"id":229212023,"uuid":"774038050","full_name":"runreal/runtrigger","owner":"runreal","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-05T20:44:57.000Z","size":51,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-01T11:26:14.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runreal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-18T20:46:45.000Z","updated_at":"2025-05-09T23:17:37.000Z","dependencies_parsed_at":"2025-03-18T19:41:45.206Z","dependency_job_id":"5a7c5703-5000-4fc2-9b18-ee864ddad59a","html_url":"https://github.com/runreal/runtrigger","commit_stats":null,"previous_names":["runreal/triggerr","runreal/runtrigger"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/runreal/runtrigger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runreal%2Fruntrigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runreal%2Fruntrigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runreal%2Fruntrigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runreal%2Fruntrigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runreal","download_url":"https://codeload.github.com/runreal/runtrigger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runreal%2Fruntrigger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262026903,"owners_count":23246952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-24T22:14:30.293Z","updated_at":"2026-04-29T14:02:38.471Z","avatar_url":"https://github.com/runreal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runtrigger\n`runtrigger` is a command-line tool for managing and creating Perforce triggers written in TypeScript and running on Deno.\n\n- Write and configure triggers in Typescript\n- Manage triggers from simple CLI interface\n- Basic utilities and logging included\n- Read environment variables from `.env`\n\n⚠️ Currently alpha - use at your own risk. ⚠️\n\n## Example\n`runtrigger init` to initialize an empty `runtrigger` script:\n\n```ts\nimport { TriggerConfig, TriggerContext, TriggerFn } from './types.ts'\n\n// this configuration is converted into the Perforce trigger definitions\nexport const config: TriggerConfig = {\n\tname: 'example-trigger',                     // name for the trigger\n\ttype: ['change-commit'],                     // type(s) of trigger\n\tpath: ['//Engine/...', '//Project/...'],     // path(s) to trigger\n\targs: ['some-arg', '%user%', '%changelist%'] // args to pass to the trigger\n}\n\n// the function that is executed when the trigger runs\nexport const main: TriggerFn = async (args: string[], ctx: TriggerContext) =\u003e {\n\t// where args are the arguments passed to the trigger\n\tctx.log.debug('execution args', args)\n\n\t// where ctx contains the associated config, a logger, and P4 client interface\n\tctx.log.debug('context', ctx)\n\n\t// do your trigger logic\n\tconst describeCmd = await ctx.p4.runCommand('describe', ['-s', changelist])\n\tconst description = describeCmd.output\n\tctx.log.info('changelist description', description)\n\n\t// return an optional result or error\n\treturn { result: { description } }\n}\n```\n\n`runtrigger add` to add the script to the Perforce configuration:\n\n```sh\n┌───────┬─────────────────┬───────────────┬───────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n│ Index │ Name            │ Type          │ Path              │ Command                                                                                                                                 │\n├───────┼─────────────────┼───────────────┼───────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ 0     │ example-trigger │ change-commit │ //Engine/...      │ runtrigger exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist%                                                 │\n├───────┼─────────────────┼───────────────┼───────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ 1     │ example-trigger │ change-commit │ //Project/...     │ runtrigger exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist%                                                 │\n└───────┴─────────────────┴───────────────┴───────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n\n```\n\n`runtrigger exec` will now safely execute the scripts when the triggers fire, write the logs to a file, and capture any result or errors.\n\nSee `/examples` for some additional example scripts.\n\n## Install\nMake sure you have [Deno installed](https://docs.deno.com/runtime/manual/getting_started/installation).\n\n### From Source\n```sh\ngit clone https://github.com/runreal/runtrigger\ndeno install --name runtrigger --force --allow-net --allow-read --allow-env --allow-run --allow-write --allow-sys src/index.ts\nruntrigger --version\n```\n\n## Commands\n### `list`\n```\nUsage:   runtrigger list\nDescription:\n  list current triggers\n```\n\n### `init`\n```\nUsage:   runtrigger init\nDescription:\n  initialize a new runtrigger project\nOptions:                                                        \n  -p, --path  \u003cpath\u003e  - Path to initialize  (Default: \"./triggers/\")\n```\n\n### `add`\n```\nUsage:   runtrigger add \u003cscript\u003e\nDescription:\n  add a trigger\nOptions:                                                                        \n  -d, --deno-binary  \u003cdeno\u003e  - override path to the deno binary (Default: \"Deno.execPath()\")\n```\n\n### `update`\n```\nUsage:   runtrigger update \u003cscript\u003e                \nDescription:\n  update a trigger\nOptions:                                                                             \n  -d, --deno-binary  \u003cdeno\u003e  - override path to the deno binary (Default: \"Deno.execPath()\")\n```\n\n### `rm`\n```\nUsage:   runtrigger rm \u003ctrigger-index\u003e                   \nDescription:\n  remove a trigger\n```\n\n### `exec`\n```\nUsage:   runtrigger exec \u003cscript\u003e [args...]\nDescription:\n  execute a trigger with optional arguments\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunreal%2Fruntrigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunreal%2Fruntrigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunreal%2Fruntrigger/lists"}