{"id":17188236,"url":"https://github.com/jclem/dpx","last_synced_at":"2025-04-13T19:13:28.547Z","repository":{"id":42892099,"uuid":"254194664","full_name":"jclem/dpx","owner":"jclem","description":"Send repository and workflow dispatches with ease","archived":false,"fork":false,"pushed_at":"2022-03-26T11:46:41.000Z","size":46,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T11:33:12.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npm.im/dpx","language":"JavaScript","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/jclem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-08T20:34:28.000Z","updated_at":"2020-12-18T14:26:07.000Z","dependencies_parsed_at":"2022-08-26T13:31:38.688Z","dependency_job_id":null,"html_url":"https://github.com/jclem/dpx","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fdpx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fdpx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fdpx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fdpx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jclem","download_url":"https://codeload.github.com/jclem/dpx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766747,"owners_count":21158301,"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":"2024-10-15T01:08:28.220Z","updated_at":"2025-04-13T19:13:28.528Z","avatar_url":"https://github.com/jclem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dpx \u003cimg src=\"send.svg\" align=\"bottom\" height=\"24px\" /\u003e\n\nThis is a utility for sending [repository dispatch][repository_dispatch] and\n[workflow dispatch][workflow_dispatch] events to GitHub repositories.\n\n## Use\n\nThis tool attempts to allow you to dispatch events quickly with as little\ntyping as possible, provided you've got your environment set up for it:\n\n- You can avoid passing a GitHub token manually by setting a `GITHUB_TOKEN`\n  environment variable.\n- You can avoid passing a GitHub repository by having a git remote called\n  \"origin\" in your .git/config that points to a GitHub repository\n- By default, dpx attempts to parse values as JSON (pass `--raw` to avoid this)\n- The presence of the `-w/--workflow` flag indicates dpx should send a\n  workflow dispatch event instead of a repository dispatch event.\n\n```shell\n# Send a \"test\" repo dispatch event.\n\u003e npx dpx test\n\n# Send a \"deploy\" repo dispatch event with a payload `{\"branch\": \"main\"}`.\n\u003e npx dpx deploy branch=main\n\n# Send a \"db-migrate\" repo dispatch event with a payload `{\"direction\": \"up\", \"count\": 1}`\n\u003e npx dpx db-migrate direction=up count=1\n\n# Send a \"db-migrate\" repo dispatch event with a payload `{\"direction\": \"up\", \"count\": \"1\"}`\n\u003e npx dpx --raw db-migrate direction=up count=1\n\n# Trigger the \"test.yml\" workflow on the \"dev\" branch with the payload `{\"fast\": \"true\"}`\n\u003e npx dpx -w test.yml -f dev fast=true\n```\n\n### Flags \u0026 Arguments\n\n- `-r`/`--repo` A name-with-owner string (as in `jclem/dpx`) pointing to the\n  repository for the dispatch to be sent to\n- `-t`/`--token` A GitHub personal access token with `repo` scope\n- `-v`/`--version` Display the version of dpx\n- `--raw` Do not parse values in key=value pairs\n- `-d`/`--dry-run` Log event type and payload, but don't send a request\n- `-h`/`--help` Display the help message\n- `-w`/`--workflow` The workflow to use for a workflow dispatch event\n- `-f`/`--ref` The ref to run from for a workflow dispatch event (defaults to the default branch of the repository)\n- `$event` The first non-flag argument is interpreted as the event for repository dispatches\n- `$key=$value` Any number of key-value pairs that are parsed and sent as a\n  JSON object as the event payload\n\n## Context\n\nIn the GitHub ecosystem, a repository dispatch event is an event sent to a\nparticular GitHub repository by a user, app, or tool with an arbitrary type\nand JSON payload. A workflow dispatch is an event that triggers a single\nworkflow with a predefined set of inputs.\n\nSince GitHub Actions allows workflows to be kicked off by these events, this\nflexibility makes repository and workflow dispatches a powerful tool for\nautomating many day-to-day async tasks, such as app deployments, building and\npackaging, and many other use cases.\n\n[repository_dispatch]: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-repository-dispatch-event\n[workflow_dispatch]: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-a-workflow-dispatch-event\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fdpx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjclem%2Fdpx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fdpx/lists"}