Workflow dispatch defaults to first repository's branch in multi-root workspaces
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- git, github-actions, typescript, vscode
- Lĩnh vực
- devtools
Hướng nghiên cứu
Start in src/git/repository.ts, where getGitHead() reads git.repositories[0].state.HEAD, then follow its caller in triggerWorkflowRun.ts, which already has gitHubRepoContext for the selected workflow. Change the lookup so the ref comes from the workflow's own repository, and check that the default falls back to gitHubRepoContext.defaultBranch. Done when the dispatch ref prefills with the branch of the workflow's repository in a multi-root workspace.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 containing the selected workflow.
The 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.
Steps to reproduce
- Create a multi-root workspace containing two or more GitHub repositories.
- Check out different branches in the repositories, for example:
- Repository A:
branch-a - Repository B:
branch-b
- Repository A:
- Open a
workflow_dispatchworkflow from Repository B. - Trigger the workflow using the editor action or GitHub Actions explorer.
- Observe the value in Enter ref to trigger workflow on.
Expected behavior
The ref defaults to refs/heads/branch-b, the current branch of the repository containing the selected workflow.
Actual behavior
The ref defaults to refs/heads/branch-a, the current branch of the first repository known to VS Code's Git extension.
Probable cause
triggerWorkflowRun.ts correctly resolves gitHubRepoContext from the workflow file's workspace folder, but obtains the default ref through getGitHead():
value: (await getGitHead()) || gitHubRepoContext.defaultBranch
getGitHead() in src/git/repository.ts always reads git.repositories[0]:
const head = git.repositories[0].state.HEAD;
This ignores the workflow's workspace/repository context.
Suggested fix
Resolve 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.
Environment
- VS Code: 1.141.0 (
2a59476c9bfcb90b3ddc372c36762471b7dfad1c), x64 - GitHub Actions extension: 0.32.3
- OS: Windows
- Workspace: multi-root with multiple local GitHub repositories
- Ngôn ngữ chính
- TypeScript
- Star
- 665
- Fork
- 221
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/vscode-github-actions
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/vscode-github-actions#627 · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
github/vscode-github-actions#633 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
github/vscode-github-actions#630 · 3 bình luận · 3 reaction ·
-
long workĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
github/vscode-github-actions#628 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
github/vscode-github-actions#625 ·
Tất cả issue của github/vscode-github-actions
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AvaProtocol/ava-sdk-js#276 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
useFragment does not require `variables` when the fragment's variables type has required fieldsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apollographql/apollo-client#13493 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsCó thể đã có người làm @roboomp đã nhận hôm nay. Đang mởbug prio:p2 providers triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
can1357/oh-my-pi#15798 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
code-yeongyu/oh-my-openagent#10172 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
PDFCraftTool/pdfcraft#189 ·