Title: Workflow dispatch defaults to first repository's branch in multi-root workspaces · Issue #634 · github/vscode-github-actions · GitHub
Open Graph Title: Workflow dispatch defaults to first repository's branch in multi-root workspaces · Issue #634 · github/vscode-github-actions
X Title: Workflow dispatch defaults to first repository's branch in multi-root workspaces · Issue #634 · github/vscode-github-actions
Description: Description When triggering a workflow_dispatch workflow from a multi-root VS Code workspace containing multiple Git repositories, the ref input is prefilled with the current branch of the first Git repository rather than the repository ...
Open Graph Description: Description When triggering a workflow_dispatch workflow from a multi-root VS Code workspace containing multiple Git repositories, the ref input is prefilled with the current branch of the first Gi...
X Description: Description When triggering a workflow_dispatch workflow from a multi-root VS Code workspace containing multiple Git repositories, the ref input is prefilled with the current branch of the first Gi...
Opengraph URL: https://github.com/github/vscode-github-actions/issues/634
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Workflow dispatch defaults to first repository's branch in multi-root workspaces","articleBody":"## Description\n\nWhen triggering a `workflow_dispatch` workflow from a multi-root VS Code workspace containing multiple Git repositories, the ref input is prefilled with the current branch of the first Git repository rather than the repository containing the selected workflow.\n\nThe workflow itself is dispatched against the correct repository, but the default ref often belongs to another repository. This requires manually correcting the branch on nearly every dispatch and can accidentally trigger a workflow on the wrong ref when branch names overlap.\n\n## Steps to reproduce\n\n1. Create a multi-root workspace containing two or more GitHub repositories.\n2. Check out different branches in the repositories, for example:\n - Repository A: `branch-a`\n - Repository B: `branch-b`\n3. Open a `workflow_dispatch` workflow from Repository B.\n4. Trigger the workflow using the editor action or GitHub Actions explorer.\n5. Observe the value in **Enter ref to trigger workflow on**.\n\n## Expected behavior\n\nThe ref defaults to `refs/heads/branch-b`, the current branch of the repository containing the selected workflow.\n\n## Actual behavior\n\nThe ref defaults to `refs/heads/branch-a`, the current branch of the first repository known to VS Code's Git extension.\n\n## Probable cause\n\n`triggerWorkflowRun.ts` correctly resolves `gitHubRepoContext` from the workflow file's workspace folder, but obtains the default ref through `getGitHead()`:\n\n```ts\nvalue: (await getGitHead()) || gitHubRepoContext.defaultBranch\n```\n\n`getGitHead()` in `src/git/repository.ts` always reads `git.repositories[0]`:\n\n```ts\nconst head = git.repositories[0].state.HEAD;\n```\n\nThis ignores the workflow's workspace/repository context.\n\n## Suggested fix\n\nResolve HEAD from `gitHubRepoContext.repositoryState`, or change `getGitHead` to accept the workflow's workspace URI/repository context and retrieve the corresponding Git repository before reading HEAD.\n\n## Environment\n\n- VS Code: 1.141.0 (`2a59476c9bfcb90b3ddc372c36762471b7dfad1c`), x64\n- GitHub Actions extension: 0.32.3\n- OS: Windows\n- Workspace: multi-root with multiple local GitHub repositories","author":{"url":"https://github.com/MehmetKinsey","@type":"Person","name":"MehmetKinsey"},"datePublished":"2026-10-09T08:49:53Z","url":"https://github.com/github/vscode-github-actions/issues/634"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e7b452f3-ace2-dae3-9b4e-2db074d67e31 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9FA:1E3FF9:9B7F4:D62DF:6AFD8993 |
| html-safe-nonce | ec5f9a13e7b91e8e4522d2cc578be6e715b0ba9656ed50e2b63871cd2fae201b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUZBOjFFM0ZGOTo5QjdGNDpENjJERjo2QUZEODk5MyIsInZpc2l0b3JfaWQiOiIzMzM0MzU3MTM3MTY0NzAwMDUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7e1ec7c4f0665b2806f948d9d21f83aa136cef3598a17a8c046fef70ca9b96f8 |
| hovercard-subject-tag | issue:5775460252 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/vscode-github-actions/634/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab3f630916fc8b230b5f8b83fe1bb3a9271df1856245f3d0cca83cefaf1df9b8/github/vscode-github-actions/issues/634 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab3f630916fc8b230b5f8b83fe1bb3a9271df1856245f3d0cca83cefaf1df9b8/github/vscode-github-actions/issues/634 |
| og:image:alt | Description When triggering a workflow_dispatch workflow from a multi-root VS Code workspace containing multiple Git repositories, the ref input is prefilled with the current branch of the first Gi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MehmetKinsey |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/github/vscode-github-actions git https://github.com/github/vscode-github-actions.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 616663763 |
| octolytics-dimension-repository_nwo | github/vscode-github-actions |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 616663763 |
| octolytics-dimension-repository_network_root_nwo | github/vscode-github-actions |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width