Skip to content

Comments

Add workflow ID support to compile command for Copilot agent compatibility#94

Merged
pelikhan merged 6 commits intomainfrom
copilot/fix-93
Aug 18, 2025
Merged

Add workflow ID support to compile command for Copilot agent compatibility#94
pelikhan merged 6 commits intomainfrom
copilot/fix-93

Conversation

Copy link
Contributor

Copilot AI commented Aug 18, 2025

The gh aw compile command now accepts workflow IDs (filename without extension) as arguments, in addition to full file paths. This enhancement was requested to improve Copilot agent compatibility, as agents frequently attempt to use workflow IDs instead of full paths.

What Changed

Previously, the compile command only worked with full file paths:

# This worked
gh aw compile .github/workflows/weekly-research.md

# This failed
gh aw compile weekly-research

Now both approaches work seamlessly:

# Workflow ID automatically resolves to the correct file
gh aw compile weekly-research
✓ .github/workflows/weekly-research.md

# Full paths continue working (backward compatibility)
gh aw compile .github/workflows/weekly-research.md
✓ .github/workflows/weekly-research.md

Implementation

The solution leverages the existing resolveWorkflowFile function that was already implemented for the run command. This ensures consistency across commands and minimal code changes. The resolution logic:

  1. Tries the input as a direct file path first (maintains full backward compatibility)
  2. If that fails, resolves it as a workflow ID by searching .github/workflows/ directory
  3. Provides clear error messages for nonexistent or ambiguous workflows
  4. Handles temporary file cleanup for package-based workflows

Error Handling

Clear error messages are provided for invalid workflow IDs:

gh aw compile nonexistent-workflow
✗ failed to resolve workflow: workflow 'nonexistent-workflow' not found in local .github/workflows, components or packages

This change makes the compile command more user-friendly and consistent with how Copilot agents expect to interact with the tool, while maintaining full backward compatibility with existing usage patterns.

Fixes #93.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build851676803/b270/cli.test -test.testlogfile=/tmp/go-build851676803/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1057377131/b270/cli.test -test.testlogfile=/tmp/go-build1057377131/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build2811590555/b270/cli.test -test.testlogfile=/tmp/go-build2811590555/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 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.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] [copilot] compile should support workflow-id Add workflow ID support to compile command for Copilot agent compatibility Aug 18, 2025
Copilot AI requested a review from pelikhan August 18, 2025 16:15
…ould not create files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 18, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3670963886/b270/cli.test -test.testlogfile=/tmp/go-build3670963886/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1919949244/b270/cli.test -test.testlogfile=/tmp/go-build1919949244/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pelikhan August 18, 2025 16:42
@pelikhan pelikhan marked this pull request as ready for review August 18, 2025 18:42
@pelikhan pelikhan requested a review from dsyme August 18, 2025 18:46
@pelikhan pelikhan enabled auto-merge (squash) August 18, 2025 20:44
@pelikhan pelikhan disabled auto-merge August 18, 2025 20:44
@pelikhan pelikhan merged commit 006c308 into main Aug 18, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/fix-93 branch August 18, 2025 20:45
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.

[copilot] compile should support workflow-id

2 participants