From 489082047c82ff3e641d8f48a96bc04e1ad6bae1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:24:23 +0000 Subject: [PATCH 1/2] Initial plan From d05a45e0aa20da925aa09b472e49320a55d329ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:29:23 +0000 Subject: [PATCH 2/2] Add CI validation for agent file URLs and improve lock file check Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/agents/agentic-workflows.agent.md | 18 +++++----- .github/workflows/ci.yml | 42 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/.github/agents/agentic-workflows.agent.md b/.github/agents/agentic-workflows.agent.md index 82949819842..6ae17020830 100644 --- a/.github/agents/agentic-workflows.agent.md +++ b/.github/agents/agentic-workflows.agent.md @@ -27,7 +27,7 @@ Workflows may optionally include: - Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md` - Workflow lock files: `.github/workflows/*.lock.yml` - Shared components: `.github/workflows/shared/*.md` -- Configuration: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/github-agentic-workflows.md +- Configuration: https://github.com/github/gh-aw/blob/main/.github/aw/github-agentic-workflows.md ## Problems This Solves @@ -49,7 +49,7 @@ When you interact with this agent, it will: ### Create New Workflow **Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/create-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/create-agentic-workflow.md **Use cases**: - "Create a workflow that triages issues" @@ -59,7 +59,7 @@ When you interact with this agent, it will: ### Update Existing Workflow **Load when**: User wants to modify, improve, or refactor an existing workflow -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/update-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/update-agentic-workflow.md **Use cases**: - "Add web-fetch tool to the issue-classifier workflow" @@ -69,7 +69,7 @@ When you interact with this agent, it will: ### Debug Workflow **Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/debug-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/debug-agentic-workflow.md **Use cases**: - "Why is this workflow failing?" @@ -79,7 +79,7 @@ When you interact with this agent, it will: ### Upgrade Agentic Workflows **Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/upgrade-agentic-workflows.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/upgrade-agentic-workflows.md **Use cases**: - "Upgrade all workflows to the latest version" @@ -89,7 +89,7 @@ When you interact with this agent, it will: ### Create Shared Agentic Workflow **Load when**: User wants to create a reusable workflow component or wrap an MCP server -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/create-shared-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/create-shared-agentic-workflow.md **Use cases**: - "Create a shared component for Notion integration" @@ -100,7 +100,7 @@ When you interact with this agent, it will: **Load when**: Creating or updating workflows that coordinate multiple agents or dispatch work to other workflows -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/orchestration.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/orchestration.md **Use cases**: - Assigning work to AI coding agents @@ -112,7 +112,7 @@ When you interact with this agent, it will: **Load when**: Creating or updating workflows that manage GitHub Projects v2 -**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/projects.md +**Prompt file**: https://github.com/github/gh-aw/blob/main/.github/aw/projects.md **Use cases**: - Tracking items and fields with update-project @@ -160,7 +160,7 @@ gh aw compile --validate ## Important Notes -- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.45.0-33-g6615116d61/.github/aw/github-agentic-workflows.md for complete documentation +- Always reference the instructions file at https://github.com/github/gh-aw/blob/main/.github/aw/github-agentic-workflows.md for complete documentation - Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud - Workflows must be compiled to `.lock.yml` files before running in GitHub Actions - **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 244c9b3be4c..49eb61e48c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -640,6 +640,11 @@ jobs: # Find all .lock.yml files in the repository LOCK_FILES=$(find . -type f -name "*.lock.yml" | sort) + if [ -z "$LOCK_FILES" ]; then + echo "⚠️ WARNING: No .lock.yml files found" + exit 0 + fi + # Track if any release-compiled files are found FOUND_RELEASE=0 @@ -680,6 +685,43 @@ jobs: echo "✅ All lock files compiled with development build (no version in header)" + - name: Check agent file URLs use main branch + run: | + echo "🔍 Checking .github/agents/agentic-workflows.agent.md for correct branch URLs..." + + AGENT_FILE=".github/agents/agentic-workflows.agent.md" + + if [ ! -f "$AGENT_FILE" ]; then + echo "⚠️ WARNING: $AGENT_FILE not found, skipping check" + exit 0 + fi + + # Check for URLs that don't use 'main' branch + # Pattern matches: https://github.com/github/gh-aw/blob/{anything-except-main}/ + # Uses negative lookahead to exclude 'main' + INVALID_URLS=$(grep -n 'https://github.com/github/gh-aw/blob/' "$AGENT_FILE" | grep -v '/blob/main/' || true) + + if [ -n "$INVALID_URLS" ]; then + echo "❌ ERROR: Found URLs not using 'main' branch in $AGENT_FILE" + echo "" + echo "Lines with invalid URLs:" + echo "$INVALID_URLS" + echo "" + echo "💡 All GitHub URLs in agent files must reference the 'main' branch!" + echo "" + echo "URLs should use the pattern:" + echo " https://github.com/github/gh-aw/blob/main/.github/aw/..." + echo "" + echo "To fix:" + echo " 1. Edit $AGENT_FILE" + echo " 2. Replace all 'blob/{commit-hash}/' or 'blob/{tag}/' with 'blob/main/'" + echo " 3. Commit the updated file" + echo "" + exit 1 + fi + + echo "✅ All URLs in $AGENT_FILE correctly use 'main' branch" + js: runs-on: ubuntu-latest needs: validate-yaml