{"id":13485187,"url":"https://github.com/benc-uk/workflow-dispatch","last_synced_at":"2025-05-16T09:03:39.707Z","repository":{"id":42757263,"uuid":"278745987","full_name":"benc-uk/workflow-dispatch","owner":"benc-uk","description":"A GitHub Action for triggering workflows, using the `workflow_dispatch` event","archived":false,"fork":false,"pushed_at":"2024-08-03T09:37:55.000Z","size":486,"stargazers_count":348,"open_issues_count":13,"forks_count":130,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-05T19:15:54.450Z","etag":null,"topics":["devops","github","github-actions"],"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/benc-uk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-10T22:36:20.000Z","updated_at":"2025-05-02T15:51:16.000Z","dependencies_parsed_at":"2024-03-13T00:33:10.610Z","dependency_job_id":"418c33df-628d-4015-a8d5-f57e206e5a25","html_url":"https://github.com/benc-uk/workflow-dispatch","commit_stats":{"total_commits":54,"total_committers":5,"mean_commits":10.8,"dds":0.2962962962962963,"last_synced_commit":"798e70c97009500150087d30d9f11c5444830385"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fworkflow-dispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fworkflow-dispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fworkflow-dispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fworkflow-dispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benc-uk","download_url":"https://codeload.github.com/benc-uk/workflow-dispatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501554,"owners_count":22081528,"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":["devops","github","github-actions"],"created_at":"2024-07-31T17:01:49.899Z","updated_at":"2025-05-16T09:03:39.655Z","avatar_url":"https://github.com/benc-uk.png","language":"TypeScript","readme":"# GitHub Action for Dispatching Workflows\n\nThis action triggers another GitHub Actions workflow, using the `workflow_dispatch` event.  \nThe workflow must be configured for this event type e.g. `on: [workflow_dispatch]`\n\nThis allows you to chain workflows, the classic use case is have a CI build workflow, trigger a CD release/deploy workflow when it completes. Allowing you to maintain separate workflows for CI and CD, and pass data between them as required.\n\nFor details of the `workflow_dispatch` even see [this blog post introducing this type of trigger](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/)\n\n_Note 1._ GitHub now has a native way to chain workflows called \"reusable workflows\". See the docs on [reusing workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows). This approach is somewhat different from workflow_dispatch but it's worth keeping in mind.\n\n_Note 2._ The GitHub UI will report flows triggered by this action as \"manually triggered\" even though they have been run programmatically via another workflow and the API.\n\n_Note 3._ If you want to reference the target workflow by ID, you will need to list them with the following REST API call `curl https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows -H \"Authorization: token {{pat-token}}\"`\n\n## Action Inputs\n\n### `workflow`\n\n**Required.** The name, filename or ID of the workflow to be triggered and run. All three possibilities are used when looking for the workflow. e.g.\n\n```yaml\nworkflow: My Workflow\n# or\nworkflow: my-workflow.yaml\n# or\nworkflow: 1218419\n```\n\n### `inputs`\n\n**Optional.** The inputs to pass to the workflow (if any are configured), this must be a JSON encoded string, e.g. `{ \"myInput\": \"foobar\" }`\n\n### `ref`\n\n**Optional.** The Git reference used with the triggered workflow run. The reference can be a branch, tag, or a commit SHA. If omitted the context ref of the triggering workflow is used. If you want to trigger on pull requests and run the target workflow in the context of the pull request branch, set the ref to `${{ github.event.pull_request.head.ref }}`.\n\n### `repo`\n\n**Optional.** The default behavior is to trigger workflows in the same repo as the triggering workflow, if you wish to trigger in another GitHub repo \"externally\", then provide the owner + repo name with slash between them e.g. `microsoft/vscode`.\n\n- When triggering across repos like this, you **must** provide a `token` (see below), or you will get an _\"Resource not accessible by integration\"_ error.\n- If the default branch in the other repo is different from the calling repo, you must provide `ref` input also, or you will get a _\"No ref found\"_ error.\n\n### `token`\n\n**Optional.** By default the standard `github.token`/`GITHUB_TOKEN` will be used and you no longer need to provide your own token here.\n\n**⚠️ IMPORTANT:** When using the `repo` option to call across repos, you **must** provide the token. In order to do so, create a PAT token with repo rights, and pass it here via a secret, e.g. `${{ secrets.MY_TOKEN }}`.\n\nThis option is also left for backwards compatibility with older versions where this field was mandatory.\n\n## Action Outputs\n\nThis Action emits a single output named `workflowId`.\n\n## Example usage\n\n```yaml\n- name: Invoke workflow without inputs\n  uses: benc-uk/workflow-dispatch@v1\n  with:\n    workflow: My Workflow\n```\n\n```yaml\n- name: Invoke workflow with inputs\n  uses: benc-uk/workflow-dispatch@v1\n  with:\n    workflow: Another Workflow\n    inputs: '{ \"message\": \"blah blah\", \"something\": true }'\n```\n\n```yaml\n- name: Invoke workflow in another repo with inputs\n  uses: benc-uk/workflow-dispatch@v1\n  with:\n    workflow: my-workflow.yaml\n    repo: benc-uk/example\n    inputs: '{ \"message\": \"blah blah\", \"something\": false }'\n    # Required when using the `repo` option. Either a PAT or a token generated from the GitHub app or CLI\n    token: \"${{ secrets.MY_TOKEN }}\"\n```\n","funding_links":[],"categories":["TypeScript","Building"],"sub_categories":["Workflows"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenc-uk%2Fworkflow-dispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenc-uk%2Fworkflow-dispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenc-uk%2Fworkflow-dispatch/lists"}