Skip to content

fix(ci): use git submodule update --remote for erdos-graph-proofs submodule updates - #52

Merged
liamjdavis merged 2 commits into
mainfrom
copilot/fix-update-erdos-graph-submodule
Feb 15, 2026
Merged

fix(ci): use git submodule update --remote for erdos-graph-proofs submodule updates#52
liamjdavis merged 2 commits into
mainfrom
copilot/fix-update-erdos-graph-submodule

Conversation

Copilot AI commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

The update-proofs-submodule job fails to update the erdos-graph submodule pointer in erdos-graph-proofs when using manual checkout/pull commands inside the submodule directory. Submodules in detached HEAD state don't propagate commit references to the parent repo with this approach.

Changes

  • Replaced manual submodule update logic with git submodule update --remote --merge erdos-graph
  • Added explicit conditional to prevent empty commits when submodule is already current

Before:

- name: Update erdos-graph submodule
  run: |
    cd erdos-graph
    git fetch origin
    git checkout main
    git pull origin main
    cd ..
    git add erdos-graph
    git diff-index --quiet HEAD || git commit -m "chore: update erdos-graph submodule to latest"

After:

- name: Update erdos-graph submodule
  run: |
    git submodule update --remote --merge erdos-graph
    git config user.name "github-actions[bot]"
    git config user.email "github-actions[bot]@users.noreply.github.com"
    if ! git diff-index --quiet HEAD -- erdos-graph; then
      git add erdos-graph
      git commit -m "chore: update erdos-graph submodule to latest"
      git push
    fi

The --remote flag fetches latest changes from the submodule's tracked branch and updates the parent repo's commit reference. The --merge flag integrates changes rather than leaving the submodule detached.

Original prompt

Problem

The update-proofs-submodule job in .github/workflows/ci.yml is not properly updating the erdos-graph submodule in the erdos-network/erdos-graph-proofs repository, even when there are new commits available on main.

The current workflow:

- name: Update erdos-graph submodule
  run: |
    cd erdos-graph
    git fetch origin
    git checkout main
    git pull origin main
    cd ..
    git config user.name "github-actions[bot]"
    git config user.email "github-actions[bot]@users.noreply.github.com"
    git add erdos-graph
    git diff-index --quiet HEAD || git commit -m "chore: update erdos-graph submodule to latest"
    git push

This approach has an issue: when the submodule is checked out, it may be in a detached HEAD state pointing to a specific commit (e.g., 953093a). When you git pull origin main inside the submodule directory, Git updates the working directory files but doesn't properly update the submodule pointer that the parent repository tracks. As a result, git add erdos-graph in the parent repo sees no changes, and no commit is made.

Solution

Replace the manual submodule update logic with Git's built-in git submodule update --remote command, which properly updates the submodule reference and ensures the parent repository tracks the new commit SHA.

Update the workflow step to:

- name: Update erdos-graph submodule
  run: |
    git submodule update --remote --merge erdos-graph
    git config user.name "github-actions[bot]"
    git config user.email "github-actions[bot]@users.noreply.github.com"
    if ! git diff-index --quiet HEAD -- erdos-graph; then
      git add erdos-graph
      git commit -m "chore: update erdos-graph submodule to latest"
      git push
    fi

This approach:

  1. Uses git submodule update --remote --merge which fetches the latest changes from the submodule's remote and updates the parent repo's reference
  2. Properly detects changes with git diff-index before attempting to commit
  3. Only commits and pushes if there are actual changes to the submodule pointer

File to modify

  • .github/workflows/ci.yml - Update the update-proofs-submodule job's "Update erdos-graph submodule" step (around line 157-169)

This pull request was created from Copilot chat.


💡 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: liamjdavis <66973153+liamjdavis@users.noreply.github.com>
@liamjdavis
liamjdavis marked this pull request as ready for review February 15, 2026 22:17
Copilot AI changed the title [WIP] Fix erdos-graph submodule update in CI workflow fix(ci): use git submodule update --remote for erdos-graph-proofs submodule updates Feb 15, 2026
@liamjdavis
liamjdavis self-requested a review February 15, 2026 22:17
@liamjdavis liamjdavis removed their assignment Feb 15, 2026
@liamjdavis
liamjdavis requested review from liamjdavis and removed request for liamjdavis February 15, 2026 22:19
@liamjdavis liamjdavis self-assigned this Feb 15, 2026
@liamjdavis liamjdavis added the bug Something isn't working label Feb 15, 2026
@liamjdavis
liamjdavis merged commit 8e14de9 into main Feb 15, 2026
8 checks passed
@liamjdavis
liamjdavis deleted the copilot/fix-update-erdos-graph-submodule branch February 15, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants