Skip to content

Stabilize Copilot Actions by normalizing git object state before request processing - #2

Merged
Priyank911 merged 1 commit into
copilot/initial-production-grade-scaffoldfrom
copilot/fix-github-actions-job
Sep 12, 2026
Merged

Priyank911 merged 1 commit into
copilot/initial-production-grade-scaffoldfrom
copilot/fix-github-actions-job

Conversation

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

The Copilot workflow was failing in the Dependabot Checker phase due to git object resolution issues in the runtime clone (unable to normalize alternate object path) and inconsistent local availability of main.
This PR adds a Copilot preflight setup workflow to normalize repository object storage and ensure the base branch ref is present before agent tools run.

  • Root-cause guardrail: git alternates normalization

    • Added .github/workflows/copilot-setup-steps.yml with a copilot-setup-steps job.
    • Detects .git/objects/info/alternates, repacks objects into the local repo, removes alternates, and verifies connectivity.
  • Base-branch availability for tooling

    • Explicitly fetches origin/main into refs/remotes/origin/main during setup to avoid base-commit lookup drift in downstream checks.
  • Copilot-specific bootstrap wiring

    • Uses actions/checkout@v5.
    • Limits permissions to contents: read.
    • Triggers on workflow dispatch and on changes to the setup workflow file (push/PR) for easy iteration.
- name: Normalize git object store for Copilot tools
  run: |
    if [[ -f .git/objects/info/alternates ]]; then
      git repack -a -d
      rm -f .git/objects/info/alternates
      git fsck --connectivity-only
    fi

- name: Ensure main is available locally
  run: git fetch --no-tags --prune origin +refs/heads/main:refs/remotes/origin/main

Co-authored-by: Priyank911 <109425795+Priyank911@users.noreply.github.com>
@Priyank911
Priyank911 marked this pull request as ready for review September 12, 2026 19:47
@Priyank911
Priyank911 merged commit 986b28a into copilot/initial-production-grade-scaffold Sep 12, 2026
3 checks passed
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