Skip to content

Commit 48556ba

Browse files
CopilotMalcolmnixon
andcommitted
Fix jq expression quotes for Windows compatibility
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 2f2c0f5 commit 48556ba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/DemaConsulting.BuildMark/RepoConnectors/GitHubRepoConnector.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ public override async Task<string> GetIssueTitleAsync(string issueId)
226226
public override async Task<string> GetIssueTypeAsync(string issueId)
227227
{
228228
// Validate and fetch issue labels using GitHub CLI
229-
// Arguments: --json labels (get labels array), --jq '.labels[].name' (extract label names)
229+
// Arguments: --json labels (get labels array), --jq .labels[].name (extract label names)
230230
// Output: one label name per line
231231
var validatedId = ValidateId(issueId, nameof(issueId));
232-
var output = await RunCommandAsync("gh", $"issue view {validatedId} --json labels --jq '.labels[].name'");
232+
var output = await RunCommandAsync("gh", $"issue view {validatedId} --json labels --jq .labels[].name");
233233
var labels = output.Split('\n', StringSplitOptions.RemoveEmptyEntries);
234234

235235
// Map labels to standardized issue types
@@ -279,9 +279,9 @@ public override async Task<string> GetIssueUrlAsync(string issueId)
279279
public override async Task<List<string>> GetOpenIssuesAsync()
280280
{
281281
// Fetch all open issue numbers using GitHub CLI
282-
// Arguments: --state open (open issues only), --json number (get number field), --jq '.[].number' (extract numbers from array)
282+
// Arguments: --state open (open issues only), --json number (get number field), --jq .[].number (extract numbers from array)
283283
// Output: one issue number per line
284-
var output = await RunCommandAsync("gh", "issue list --state open --json number --jq '.[].number'");
284+
var output = await RunCommandAsync("gh", "issue list --state open --json number --jq .[].number");
285285

286286
// Parse output into list of issue IDs
287287
return output

test/DemaConsulting.BuildMark.Tests/GitHubRepoConnectorTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public async Task GitHubRepoConnector_GetIssueTypeAsync_ReturnsBugForBugLabel()
311311
{
312312
// Arrange
313313
var connector = new TestableGitHubRepoConnector();
314-
connector.AddCommandResult("gh", "issue view 123 --json labels --jq '.labels[].name'", "bug\npriority:high");
314+
connector.AddCommandResult("gh", "issue view 123 --json labels --jq .labels[].name", "bug\npriority:high");
315315

316316
// Act
317317
var type = await connector.GetIssueTypeAsync("123");
@@ -328,7 +328,7 @@ public async Task GitHubRepoConnector_GetIssueTypeAsync_ReturnsFeatureForEnhance
328328
{
329329
// Arrange
330330
var connector = new TestableGitHubRepoConnector();
331-
connector.AddCommandResult("gh", "issue view 123 --json labels --jq '.labels[].name'", "enhancement");
331+
connector.AddCommandResult("gh", "issue view 123 --json labels --jq .labels[].name", "enhancement");
332332

333333
// Act
334334
var type = await connector.GetIssueTypeAsync("123");
@@ -345,7 +345,7 @@ public async Task GitHubRepoConnector_GetIssueTypeAsync_ReturnsOtherForUnknownLa
345345
{
346346
// Arrange
347347
var connector = new TestableGitHubRepoConnector();
348-
connector.AddCommandResult("gh", "issue view 123 --json labels --jq '.labels[].name'", "question");
348+
connector.AddCommandResult("gh", "issue view 123 --json labels --jq .labels[].name", "question");
349349

350350
// Act
351351
var type = await connector.GetIssueTypeAsync("123");

0 commit comments

Comments
 (0)