Workflow dispatch defaults to first repository's branch in multi-root workspaces
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- git, github-actions, typescript, vscode
- Bereich
- devtools
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 665
- Forks
- 221
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/vscode-github-actions
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
github/vscode-github-actions#627 · 2 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
github/vscode-github-actions#633 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
github/vscode-github-actions#630 · 3 Kommentare · 3 Reaktionen ·
-
long workOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
github/vscode-github-actions#628 ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
github/vscode-github-actions#625 ·
Alle Issues in github/vscode-github-actions
Ähnliche Issues
-
`cf complete zsh >> .zshrc` fails on vanilla zshEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
cloudflare/cf#340 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Rename Madson cameraOffen
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
StoDevX/AAO-React-Native#8785 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Broken links in the docsOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commitEvtl. vergeben @myOmikron hat das heute übernommen. Offenbug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100