Skip to content

Add GitHub Actions workflow to automate metashade submodule updates#81

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-4424a26e-de15-4323-a773-32dfcb7d9b4a
Draft

Add GitHub Actions workflow to automate metashade submodule updates#81
Copilot wants to merge 2 commits intomainfrom
copilot/fix-4424a26e-de15-4323-a773-32dfcb7d9b4a

Conversation

Copy link
Copy Markdown

Copilot AI commented Sep 29, 2025

This PR implements an automated workflow to keep the metashade submodule up-to-date whenever changes are pushed to metashade/main.

Problem

Previously, the metashade submodule had to be manually updated whenever new changes were available in the upstream repository. This led to potential delays in incorporating important fixes and improvements, and required manual intervention to keep the glTF sample project synchronized.

Solution

Added a comprehensive GitHub Actions workflow that automatically:

  • Detects submodule updates: Compares current submodule commit with latest metashade/main
  • Creates pull requests: Automatically opens PRs with detailed change information when updates are available
  • Provides multiple triggers: Repository dispatch (from metashade repo), manual execution, and daily scheduled checks
  • Includes rich metadata: PR descriptions contain commit hashes, messages, and links to changes

Key Features

Smart Update Detection

The workflow only creates PRs when actual updates are needed, avoiding unnecessary noise:

- name: Check if update is needed
  run: |
    if [ "$CURRENT_COMMIT" != "$NEW_COMMIT" ]; then
      echo "needs_update=true"
    fi

Multiple Trigger Methods

  1. Repository Dispatch - Triggered by pushes to metashade/main (recommended)
  2. Manual Trigger - Can be run on-demand with optional target ref
  3. Scheduled Updates - Daily checks at 02:00 UTC as backup

Detailed PR Information

Generated PRs include:

  • Previous and new commit hashes
  • Latest commit message from metashade
  • Automatic CI validation via existing test suite

Files Added

  • .github/workflows/update-metashade-submodule.yml - Main automation workflow
  • .github/SUBMODULE_UPDATE_SETUP.md - Complete setup documentation
  • .github/metashade-repository-workflow-example.yml - Example trigger workflow for metashade repo

Setup Required

To enable repository dispatch triggering (most responsive method):

  1. Add the example workflow to metashade/metashade repository
  2. Create GLTF_SAMPLE_DISPATCH_TOKEN secret in metashade repo with appropriate permissions

Testing

The workflow has been validated with:

  • YAML syntax verification
  • Submodule operation simulation
  • Permission and security review
  • Integration with existing CI pipeline

Once merged, this will ensure the glTF sample project automatically stays current with metashade developments, reducing maintenance overhead and improving project synchronization.

Original prompt

This section details on the original issue you should resolve

<issue_title>Automate updates of the metashade submodule</issue_title>
<issue_description>Add a GHA workflow that would create a PR with an updated metashade submodule whenever metashade/main is pushed to.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #80

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: ppenenko <1525958+ppenenko@users.noreply.github.com>
Copilot AI changed the title [WIP] Automate updates of the metashade submodule Add GitHub Actions workflow to automate metashade submodule updates Sep 29, 2025
Copilot AI requested a review from ppenenko September 29, 2025 23:09
@ppenenko
Copy link
Copy Markdown
Member

What happens if Metashade is updated again, after a PR has been created with this workflow?

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.

Automate updates of the metashade submodule

2 participants