{"id":13485189,"url":"https://github.com/peter-evans/repository-dispatch","last_synced_at":"2025-05-13T19:03:07.320Z","repository":{"id":41812180,"uuid":"220359305","full_name":"peter-evans/repository-dispatch","owner":"peter-evans","description":"A GitHub action to create a repository dispatch event","archived":false,"fork":false,"pushed_at":"2025-04-25T09:45:54.000Z","size":3342,"stargazers_count":1039,"open_issues_count":4,"forks_count":147,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-06T02:01:42.920Z","etag":null,"topics":["github-action","github-api","repository-dispatch","webhook-events"],"latest_commit_sha":null,"homepage":"","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/peter-evans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null},"funding":{"github":"peter-evans"}},"created_at":"2019-11-08T01:12:37.000Z","updated_at":"2025-05-03T07:16:24.000Z","dependencies_parsed_at":"2024-04-12T10:43:51.740Z","dependency_job_id":"280e0480-27cd-4244-9692-95ba5508e330","html_url":"https://github.com/peter-evans/repository-dispatch","commit_stats":{"total_commits":338,"total_committers":10,"mean_commits":33.8,"dds":0.4023668639053254,"last_synced_commit":"28a02cc85a65462275a97039562642d3731c318c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Frepository-dispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Frepository-dispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Frepository-dispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Frepository-dispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter-evans","download_url":"https://codeload.github.com/peter-evans/repository-dispatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253317168,"owners_count":21889530,"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":["github-action","github-api","repository-dispatch","webhook-events"],"created_at":"2024-07-31T17:01:49.946Z","updated_at":"2025-05-13T19:03:07.296Z","avatar_url":"https://github.com/peter-evans.png","language":"TypeScript","readme":"# Repository Dispatch\n[![CI](https://github.com/peter-evans/repository-dispatch/workflows/CI/badge.svg)](https://github.com/peter-evans/repository-dispatch/actions?query=workflow%3ACI)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Repository%20Dispatch-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/repository-dispatch)\n\nA GitHub action to create a repository dispatch event.\n\n## Usage\n\nDispatch an event to the current repository.\n```yml\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v3\n        with:\n          event-type: my-event\n```\n\nDispatch an event to a remote repository using a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n```yml\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v3\n        with:\n          token: ${{ secrets.PAT }}\n          repository: username/my-repo\n          event-type: my-event\n```\n\n### Action inputs\n\n| Name | Description | Default |\n| --- | --- | --- |\n| `token` | `GITHUB_TOKEN` (permissions `contents: write`) or a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). See [token](#token) for further details. | `GITHUB_TOKEN` |\n| `repository` | The full name of the repository to send the dispatch. | `github.repository` (current repository) |\n| `event-type` | (**required**) A custom webhook event name. | |\n| `client-payload` | JSON payload with extra information about the webhook event that your action or workflow may use. | `{}` |\n\n#### Token\n\nThis action creates [`repository_dispatch`](https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event) events.\nThe default `GITHUB_TOKEN` token can only be used if you are dispatching the same repository that the workflow is executing in.\n\nTo dispatch to a remote repository you must create a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the `repo` scope and store it as a secret.\nIf you will be dispatching to a public repository then you can use the more limited `public_repo` scope.\n\nYou can also use a [fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) (beta). It needs the following permissions on the target repositories:\n - `contents: read \u0026 write`\n - `metadata: read only` (automatically selected when selecting the contents permission)\n\n## Example\n\nHere is an example setting all of the input parameters.\n\n```yml\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v3\n        with:\n          token: ${{ secrets.PAT }}\n          repository: username/my-repo\n          event-type: my-event\n          client-payload: '{\"ref\": \"${{ github.ref }}\", \"sha\": \"${{ github.sha }}\"}'\n```\n\nHere is an example `on: repository_dispatch` workflow to receive the event.\nNote that repository dispatch events will only trigger a workflow run if the workflow is committed to the default branch.\n\n```yml\nname: Repository Dispatch\non:\n  repository_dispatch:\n    types: [my-event]\njobs:\n  myEvent:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          ref: ${{ github.event.client_payload.ref }}\n      - run: echo ${{ github.event.client_payload.sha }}\n```\n\n### Dispatch to multiple repositories\n\nYou can dispatch to multiple repositories by using a [matrix strategy](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix). In the following example, after the `build` job succeeds, an event is dispatched to three different repositories.\n\n```yml\njobs:\n  build:\n    # Main workflow job that builds, tests, etc.\n\n  dispatch:\n    needs: build\n    strategy:\n      matrix:\n        repo: ['my-org/repo1', 'my-org/repo2', 'my-org/repo3']\n    runs-on: ubuntu-latest\n    steps:\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v3\n        with:\n          token: ${{ secrets.PAT }}\n          repository: ${{ matrix.repo }}\n          event-type: my-event\n```\n\n## Client payload\n\nThe GitHub API allows a maximum of 10 top-level properties in the `client-payload` JSON.\nIf you use more than that you will see an error message like the following.\n\n```\nNo more than 10 properties are allowed; 14 were supplied.\n```\n\nFor example, this payload will fail because it has more than 10 top-level properties.\n\n```yml\nclient-payload: ${{ toJson(github) }}\n```\n\nTo solve this you can simply wrap the payload in a single top-level property.\nThe following payload will succeed.\n\n```yml\nclient-payload: '{\"github\": ${{ toJson(github) }}}'\n```\n\nAdditionally, there is a limitation on the total data size of the `client-payload`. A very large payload may result in a `client_payload is too large` error.\n\n### Multiline\n\nA multiline `client-payload` can be set directly in YAML, as in the following example.\n\n```yml\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v3\n        with:\n          token: ${{ secrets.PAT }}\n          repository: username/my-repo\n          event-type: my-event\n          client-payload: |-\n            {\n              \"repo\": {\n                \"name\": \"${{ github.repository }}\",\n                \"branch\": \"${{ needs.build_cfg.outputs.REPO_BRANCH }}\",\n                \"tag\": \"${{ needs.build_cfg.outputs.REPO_TAG }}\"\n              },\n              \"deployment\": {\n                \"project\": \"${{ env.MY_PROJECT }}\",\n                \"container\": \"${{ env.MY_CONTAINER }}\",\n                \"deploy_msg\": \"${{ env.SLACK_DEPLOY_MSG }}\",\n              }\n            }\n```\n\n## License\n\n[MIT](LICENSE)\n","funding_links":["https://github.com/sponsors/peter-evans"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Frepository-dispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter-evans%2Frepository-dispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Frepository-dispatch/lists"}