Skip to content

Add yq to default bash tools#1777

Merged
pelikhan merged 4 commits intomainfrom
copilot/add-yq-tool-to-defaults
Oct 16, 2025
Merged

Add yq to default bash tools#1777
pelikhan merged 4 commits intomainfrom
copilot/add-yq-tool-to-defaults

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 16, 2025

Overview

The yq tool is pre-installed in the GitHub Actions environment and is useful for querying YAML lock files. This PR adds yq to the default bash tools list, making it automatically available in agentic workflows without requiring explicit configuration.

Motivation

Users need to query workflow lock files to extract information like job names, and yq is the standard tool for this purpose. Since it's already installed in the environment, it should be available by default alongside other common utilities like grep, cat, and sort.

Example use case:

# Query job names from a lock file
yq '.jobs | keys' .github/workflows/example.lock.yml

Changes

Before

Users had to explicitly add yq to their tools configuration:

tools:
  bash: ["yq"]

After

The yq tool is now included automatically when bash is enabled:

tools:
  bash:  # yq is included in defaults

Implementation

  • pkg/constants/constants.go: Added "yq" to the DefaultBashTools slice
  • pkg/workflow/bash_merge_test.go: Updated test expectations to include yq in the default tools list

Verification

Verified that yq appears in compiled workflows for both AI engines:

  • Copilot: --allow-tool 'shell(yq)'
  • Claude: Bash(yq) in allowed-tools

All tests pass and the change is backward compatible with existing workflows.

Impact

  • ✅ Minimal change (2 files modified)
  • ✅ All unit tests pass
  • ✅ Backward compatible
  • ✅ 64 test workflows compile successfully
  • ✅ No breaking changes
Original prompt

Try of the "yq" tool is pre installed in the environment. If some try to run queries against the lock files, like job names.
If present, add to default tool list


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 16, 2025 02:08
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add yq tool to default tool list if present Add yq to default bash tools Oct 16, 2025
Copilot AI requested a review from pelikhan October 16, 2025 02:17
@pelikhan pelikhan marked this pull request as ready for review October 16, 2025 02:25
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request

@pelikhan pelikhan merged commit 58be748 into main Oct 16, 2025
3 checks passed
@pelikhan pelikhan deleted the copilot/add-yq-tool-to-defaults branch October 16, 2025 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants