{"id":25814884,"url":"https://github.com/lasith-kg/dispatch-workflow","last_synced_at":"2025-09-11T17:19:35.034Z","repository":{"id":184815131,"uuid":"672419460","full_name":"lasith-kg/dispatch-workflow","owner":"lasith-kg","description":"A GitHub Action to Dispatch and Discover GitHub Workflows using workflow_dispatch or repository_dispatch","archived":false,"fork":false,"pushed_at":"2024-06-05T07:48:53.000Z","size":1791,"stargazers_count":9,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T11:46:10.375Z","etag":null,"topics":["actions","github-actions","repository-dispatch","workflow-dispatch"],"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/lasith-kg.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-30T02:49:40.000Z","updated_at":"2024-11-07T17:52:22.000Z","dependencies_parsed_at":"2023-11-28T12:29:46.578Z","dependency_job_id":"8732d1e1-36b3-4193-80c7-e4430a527ce3","html_url":"https://github.com/lasith-kg/dispatch-workflow","commit_stats":null,"previous_names":["lasithkoswattagamage/dispatch-workflow","lasith-kg/dispatch-workflow"],"tags_count":24,"template":false,"template_full_name":"actions/typescript-action","purl":"pkg:github/lasith-kg/dispatch-workflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasith-kg%2Fdispatch-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasith-kg%2Fdispatch-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasith-kg%2Fdispatch-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasith-kg%2Fdispatch-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lasith-kg","download_url":"https://codeload.github.com/lasith-kg/dispatch-workflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasith-kg%2Fdispatch-workflow/sbom","scorecard":{"id":579523,"data":{"date":"2025-08-11","repo":{"name":"github.com/lasith-kg/dispatch-workflow","commit":"5623bf13f09bbbbdb549ec692b070307f39b66ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/build-test.yml:13","Warn: jobLevel 'actions' permission set to 'write': .github/workflows/build-test.yml:14","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/build-test.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/integration-tests.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/build-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-test.yml:148: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/lasith-kg/dispatch-workflow/release.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T18:48:59.721Z","repository_id":184815131,"created_at":"2025-08-20T18:48:59.721Z","updated_at":"2025-08-20T18:48:59.721Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274676402,"owners_count":25329276,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["actions","github-actions","repository-dispatch","workflow-dispatch"],"created_at":"2025-02-28T03:46:56.163Z","updated_at":"2025-09-11T17:19:34.991Z","avatar_url":"https://github.com/lasith-kg.png","language":"TypeScript","readme":"# GitHub Action for Dispatching Workflows\n\nA **universal** action that supports dispatching workflows with either the `workflow_dispatch` or `repository_dispatch` event. Additionally, this action can be configured to **discover** the Run ID of a dispatched workflow through a **efficient** and **accurate** correlation algorithm.\n\nThe latter algorithm was designed as a workaround for a [technical limitation](https://github.com/orgs/community/discussions/9752#discussioncomment-1964203) that prevents the dispatch APIs from returning a Run ID.\n\nThere was a need for this action as currently available actions...\n\n- Support the `workflow_dispatch` or `repository_dispatch` event, **but not both**\n- Use Run ID extraction algorithms that are either **API-intensive** or **unreliable** on repositories that experience a high velocity of workflows\n\n# Acknowledgements\n\nThis GitHub Action is a fork of [`codex-/return-dispatch`](https://github.com/codex-/return-dispatch). This action supported the ability to extract a Run ID, but exclusively supported the `workflow_dispatch` method. I decided to fork this action as it had an intuitive code-base and excellent testing philosophy.\n\nFrom a **compatibility** and **performance** perspective, this GitHub Action superseedes [`codex-/return-dispatch`](https://github.com/codex-/return-dispatch), as it additionally supports the `repository_dispatch` method and uses a more efficient algorithm to extract the Run ID for a dispatched workflow\n\n# Usage\n\n## Creating Dispatch Events\n\n### `workflow_dispatch`\n\n```yaml\nsteps:\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: workflow-dispatch\n    name: 'Dispatch Workflow using workflow_dispatch Method'\n    with:\n      dispatch-method: workflow_dispatch\n      repo: repository-name\n      owner: repository-owner\n      ref: refs/heads/main # or main\n      workflow: automation-test.yml # Or Workflow ID\n      token: ${{ secrets.TOKEN }} # GitHub Token With Relevant Permissions\n      workflow-inputs: |\n        {\n          \"string-type\": \"placeholder\",\n          \"number-type\": \"1\",           // Workaround for 'Number' types\n          \"boolean-type\": \"true\"        // Workaround for 'Boolean' types\n        }\n```\n\n### `repository_dispatch`\n\n```yaml\nsteps:\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: repository-dispatch\n    name: 'Dispatch Workflow using repository_dispatch Method'\n    with:\n      dispatch-method: repository_dispatch\n      repo: repository-name\n      owner: repository-owner\n      event-type: deploy # Event To Trigger From Workflow\n      token: ${{ secrets.TOKEN }} # GitHub Token With Relevant Permissions\n      workflow-inputs: |\n        {\n          \"string-type\": \"placeholder\",\n          \"nested\": {                    // Supports Nesting\n            \"number-type\": 1,            // Supports Native 'Number' types\n            \"boolean-type\": true         // Supports Native 'Boolean' types\n          }\n        }\n```\n\n## Receiving Dispatch Events\n\n### `workflow_dispatch`\n\n```yaml\n# .github/workflows/automation-test.yml [refs/heads/main]\nname: Workflow Name\non:\n  workflow_dispatch:\n    inputs:\n      string-type:\n        description: An input of type 'String'\n        required: true\n        type: string\n      number-type:\n        description: An input of type 'Number'\n        type: number\n      boolean-type:\n        description: An input of type 'Boolean'\n        type: boolean\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo Inputs\n        run: |\n          echo \"${{ inputs.string-type }}\" # \"placeholder\"\n          if [[ \"${{ inputs.number-type }}\" -gt -1 ]]; then echo \"🟢\"; fi       # 🟢\n          if [[ \"${{ inputs.boolean-type }}\" == \"true\" ]]; then echo \"🟢\"; fi   # 🟢\n```\n\n### `repository_dispatch`\n\n```yaml\nname: Workflow Name\non:\n  repository_dispatch:\n    types:\n      - deploy\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo Inputs\n        run: |\n          echo \"${{ github.event.client_payload.string-type }}\" # \"placeholder\"\n          if [[ \"${{ github.event.client_payload.nested.number-type }}\" -gt -1 ]]; then echo \"🟢\"; fi      # 🟢\n          if [[ \"${{ github.event.client_payload.nested.boolean-type }}\" == \"true\" ]]; then echo \"🟢\"; fi  # 🟢\n```\n\n## Discovery\n\nOne of the drawbacks with both dispatch methods, is that they do not natively return a Run ID that allows us to query for the status of our dispatched workflow. This technical limitation is discussed more in-depth in this [community discussion](https://github.com/orgs/community/discussions/9752#discussioncomment-1964203). We can work around this by encorporating a **Distinct ID** into our dispatch event. We then have the ability to **discover** the dispatched workflow, from all workflow runs, by correlating it to the **Distinct ID**.\n\nThis functionality is **disabled by default**, but can be enabled with the `discover: true` configuration. The receiving workflow must then be modified appropriated to intercept the **Distinct ID**.\n\n### Creating Dispatch Events with Discovery\n\n```yaml\nsteps:\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: dispatch-with-discovery\n    name: \"Dispatch Workflow With Discovery\"\n    with:\n      ...\n      discover: true\n  - id: echo-run-id-url\n    name: \"Echo Run ID and Run URL\"\n    run: |\n      echo \"${{ steps.dispatch-with-discovery.outputs.run-id }}\"\n      echo \"${{ steps.dispatch-with-discovery.outputs.run-url }}\"\n```\n\n### Receiving Events with Discovery\n\nOn September 26, 2022, GitHub introduced the ability to set [dynamic names for workflow runs](https://github.blog/changelog/2022-09-26-github-actions-dynamic-names-for-workflow-runs/). The new `run-name` attribute will accept expressions, thus allowing us to inject the **Distinct ID** into the queryable view.\n\nThe expression to expose the **Distinct ID** in the `run-name` depends on what dispatch method you are using. The included expressions have been configured in a way to return a placeholder value `N/A` if a **Distinct ID** is not available.\n\n#### `workflow_dispatch`\n\n```yaml\nname: Workflow Name\nrun-name: Workflow Name [${{ inputs.distinct_id \u0026\u0026 inputs.distinct_id || 'N/A' }}]\n\non:\n  workflow_dispatch:\n    inputs:\n      distinct_id:\n        description: 'Distinct ID'\n        required: false\n```\n\n#### `repository_dispatch`\n\n```yaml\nname: Workflow Name\nrun-name: \u003e\n  Workflow Name [${{\n    github.event.client_payload.distinct_id \u0026\u0026\n    github.event.client_payload.distinct_id || 'N/A' }}]\n\non:\n  repository_dispatch:\n    types:\n      - deploy\n```\n\n# Permissions\n\nDispatching a Workflow requires an authenticated `GITHUB_TOKEN`. The required permissions for this `GITHUB_TOKEN` depends on the following factors...\n\n- **Dispatch Method**: `repository_dispatch`, `workflow_dispatch`\n- **Discovery**: `true`, `false`\n- **Repository Visiblity**: Private, Public\n\n## Generating a `GITHUB_TOKEN`\n\nThere are also multiple methods of generating `GITHUB_TOKEN`. If you are dispatching a workflow from the **current repository**, a **GitHub Actions Token** would be the most secure option. If you are dispatching a workflow to a **remote repository**, I would personally recommend a **GitHub App Token**. GitHub App Tokens are ephemeral (valid for 1 hour) and have fine grained access control over permissions and repositories. Additionally they are not bound to a particular developers identity, unlike a Personal Access Token.\n\n- Fine Grained Tokens\n  - [GitHub Actions Token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)\n  - [GitHub App Token](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow)\n  - [Personal Access Token 🆕](https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/)\n- Personal Access Tokens (Classic)\n  - I would **strongly** advise using this as they are not as secure as it's [fine-grained replacement](https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/) and can potentially be configured without an expiry time.\n\nThe below table shows the neccessary permissions for all the unique combinations of these factors. If using a Fine Grained Token, ensure that the permissions correspond to the repository that contains the workflow you are attempting to dispatch.\n\n| Mode                                     | Fine Grained Tokens                 | Personal Access Token (Classic)         |\n| ---------------------------------------- | ----------------------------------- | --------------------------------------- |\n| `repository_dispatch`                    | `contents: write`                   | Private: `repo` / Public: `public_repo` |\n| `repository_dispatch` + `discover: true` | `contents: write` + `actions: read` | Private: `repo` / Public: `public_repo` |\n| `worflow_dispatch`                       | `actions: write`                    | Private: `repo` / Public: `public_repo` |\n| `workflow_dispatch` + `discover: true`   | `actions: write`                    | Private: `repo` / Public: `public_repo` |\n\n# Inputs\n\n| Name                | Description                                                                                                                           | Required      | Default |\n| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------- |\n| `dispatch-method`   | The method that will be used for dispatching GitHub workflows: `repository_dispatch`, `workflow_dispatch`                             | `true`        |         |\n| `repo`              | Repository of the workflow to dispatch                                                                                                | `true`        |         |\n| `owner`             | Owner of the given repository                                                                                                         | `true`        |         |\n| `token`             | GitHub API token for making API requests                                                                                              | `true`        |         |\n| `ref`               | If the selected dispatch method is `workflow_dispatch`, the git reference for the workflow. The reference can be a branch or tag name | `conditional` |         |\n| `workflow`          | If the selected dispatch method is `workflow_dispatch`, the ID or the workflow file name to dispatch                                  | `conditional` |         |\n| `event-type`        | If the selected dispatch method is `repository_dispatch`, what event type will be triggered in the repository.                        | `conditional` |         |\n| `workflow-inputs`   | A JSON object that contains extra information that will be provided to the dispatch call                                              | `false`       | `'{}'`  |\n| `discover`          | A flag to enable the discovery of the Run ID from the dispatched workflow                                                             | `false`       | `false` |\n| `starting-delay-ms` | The delay, in milliseconds, before executing the function for the first time.                                                         | `false`       | `200`   |\n| `max-attempts`      | The maximum number of times to attempt read-only GitHub API requests.                                                                 | `false`       | `5`     |\n| `time-multiple`     | The `starting-delay-ms` is multiplied by the `time-multiple` to increase the delay between reattempts.                                | `false`       | `2`     |\n\n# Outputs\n\nBy default, this GitHub Action has no outputs. However, when discovery mode is **enabled**, the Run ID and Run URL become exposed as outputs. With the Run ID, you can create some powerful automation where the parent workflow can wait for the status of the child workflow using the [`codex-/await-remote-run`](https://github.com/codex-/await-remote-run) GitHub Action.\n\n| Name      | Description                                    |\n| --------- | ---------------------------------------------- |\n| `run-id`  | The Run ID of the workflow that was dispatched |\n| `run-url` | The URL of the workflow that was dispatched    |\n\n```yaml\nsteps:\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: wait-repository-dispatch\n    name: 'Dispatch Using repository_dispatch Method And Wait For Run-ID'\n    with:\n      dispatch-method: 'repository_dispatch'\n      event-type: 'deploy'\n      repo: ${{ github.event.repository.name }}\n      owner: ${{ github.repository_owner }}\n      token: ${{ secrets.GITHUB_TOKEN }}\n      discover: true\n  - name: Await Run ID ${{ steps.wait-repository-dispatch.outputs.run-id }}\n    uses: codex-/await-remote-run@v1\n    with:\n      token: ${{ secrets.GITHUB_TOKEN }}\n      repo: ${{ github.event.repository.name }}\n      owner: ${{ github.repository_owner }}\n      run_id: ${{ steps.wait-repository-dispatch.outputs.run-id }}\n      run_timeout_seconds: 300 # Optional\n      poll_interval_ms: 5000 # Optional\n```\n\n# Workflow Inputs\n\nThis action supports the ability to provide workflow inputs for both the `repository_dispatch` and `workflow_dispatch` method. However, both methods have their unique limitations.\n\n## `repository_dispatch`\n\n\u003e Source: [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch#client-payload) # Client Payload\n\nThe [Create a repository dispatch event](https://docs.github.com/en/free-pro-team@latest/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event) API call allows a maximum of **10** top-level properties in the workflow inputs JSON. If 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 the `github` object has more than **10** top-level properties.\n\n```yaml\nworkflow-inputs: ${{ toJson(github) }}\n```\n\nA simple work-around is that you can simply wrap the payload in a single top-level property. The following payload will succeed.\n\n```yaml\nworkflow-inputs: '{\"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 the following error\n\n```\nclient_payload is too large\n```\n\n## `workflow_dispatch`\n\nThe [Create a workflow dispatch event](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event) API call also sets the maximum number of top-level properties in the workflow inputs JSON to **10**. Any default properties configured in the workflow file will be considered towards this count when inputs are omitted.\n\nAn additional requirement is that all top-level properties **must** be a `string`. Any inputs represented as a `number` or `boolean` will get **rejected**. Therefore values of these\ntypes must be wrapped in **quotes** to successfully dispatch the workflow.\n\n```yaml\n# Invalid ❌\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: workflow-dispatch\n    name: 'Dispatch Using workflow_dispatch Method'\n    with:\n      dispatch-method: 'workflow_dispatch'\n      ...\n      workflow-inputs: |\n        {\n          \"foo\": true,\n          \"bar: 1\n        }\n\n# Valid 🟢\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: workflow-dispatch\n    name: 'Dispatch Using workflow_dispatch Method'\n    with:\n      dispatch-method: 'workflow_dispatch'\n      ...\n      workflow-inputs: |\n        {\n          \"foo\": \"true\",\n          \"bar: \"1\"\n        }\n```\n\n# Advanced Usage\n\n## Exponential Backoff\n\nWhen interacting with the GitHub REST API, it's beneficial to handle potential flakiness by employing exponential backoff. This action allows users to customize this behavior through optional parameters, although the default values work well for most scenarios.\n\n- `starting-delay-ms`: The initial delay, in milliseconds, before the first API call attempt.\n- `max-attempts`: The maximum number of times to attempt read-only GitHub API requests.\n- `time-multiple`: The factor by which the `starting-delay-ms` is multiplied for each reattempt, influencing the delay duration.\n\n```yaml\n  - uses: lasith-kg/dispatch-workflow@v1\n    id: custom-backoff\n    name: 'Dispatch with custom exponential backoff parameters'\n    with:\n      ...\n      starting-delay-ms: 150\n      max-attempts: 3\n      time-multiple: 1.5\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasith-kg%2Fdispatch-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasith-kg%2Fdispatch-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasith-kg%2Fdispatch-workflow/lists"}