Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

The compiler was performing manual git operations in JavaScript to checkout repository imports, leading to failures in GitHub Actions (ref: https://github.com/githubnext/gh-aw/actions/runs/21538669970/job/62069409268#step:5:1).

Changes

Compiler (pkg/workflow/compiler_yaml_main_job.go)

  • Generate actions/checkout steps for each repository import before the merge step
  • Checkout to /tmp/gh-aw/repo-imports/<owner>-<repo>-<sanitized-ref> with sparse-checkout for .github/
  • Handle ref sanitization (e.g., feature/branchfeature-branch)

Merge Script (actions/setup/js/merge_remote_agent_github_folder.cjs)

  • Look for pre-checked-out repositories in temp directory
  • Remove manual git init, git fetch, git checkout operations
  • Fail fast if checkout directory doesn't exist

Before:

// JavaScript manually performs git operations
execSync("git init", { cwd: tempDir });
execSync(`git fetch --depth 1 origin ${ref}`, { cwd: tempDir });
execSync(`git checkout FETCH_HEAD`, { cwd: tempDir });

After:

- name: Checkout repository import github/repo@main
  uses: actions/checkout@v6
  with:
    repository: github/repo
    ref: main
    path: /tmp/gh-aw/repo-imports/github-repo-main
    sparse-checkout: |
      .github/

The merge script now simply copies from the pre-checked-out folder.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21538669970/job/62069409268#step:5:1

Instead of trying to checkout "manually" the folder, the compiler should generate an actions/checkout step that places the checkout code into a temporary folder so that the script can just copy it.


💡 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 January 31, 2026 04:37
…ual git operations

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] Update checkout steps to use actions/checkout Generate actions/checkout steps for repository imports Jan 31, 2026
Copilot AI requested a review from pelikhan January 31, 2026 04:44
@github-actions
Copy link
Contributor

🔍 PR Triage Results

Category: feature | Risk: high | Priority: 50/100

Scores Breakdown

  • Impact: 30/50 - Improves repository import handling with actions/checkout
  • Urgency: 10/30 - Recent PR (0 days old) with standard urgency
  • Quality: 10/20 - Draft status, CI pending completion

📋 Recommended Action: batch_review

This PR is part of Batch #2: Feature Additions (batch-feature-001) with 5 other feature PRs. Review in sequence to understand feature interdependencies.

Next Steps:

  1. Complete CI validation
  2. Convert from draft to ready for review
  3. Coordinate review with feature batch

Triaged by PR Triage Agent on 2026-01-31 | Run #21540069309

AI generated by PR Triage Agent

@pelikhan pelikhan marked this pull request as ready for review January 31, 2026 07:00
@pelikhan pelikhan merged commit 865bde0 into main Jan 31, 2026
158 checks passed
@pelikhan pelikhan deleted the copilot/update-checkout-steps branch January 31, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants