-
Notifications
You must be signed in to change notification settings - Fork 22
Add GitHub action for syncing submodules for readthedocs #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aidanfnv
merged 4 commits into
shader-slang:main
from
aidanfnv:fix/readthedocs-submodules-sync
May 2, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Update Submodules | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run at 2:00 AM UTC every day | ||
| - cron: '0 2 * * *' | ||
| workflow_dispatch: # Allow manual trigger | ||
|
|
||
| jobs: | ||
| update-submodules: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| # Fetch all history for all branches and tags | ||
| fetch-depth: 0 | ||
| # Get submodules | ||
| submodules: 'recursive' | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config --global user.name 'github-actions' | ||
| git config --global user.email 'github-actions@github.com' | ||
|
|
||
| - name: Get default branch | ||
| id: default_branch | ||
| run: | | ||
| DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5) | ||
| echo "name=$DEFAULT_BRANCH" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Checkout default branch | ||
| run: | | ||
| git checkout ${{ steps.default_branch.outputs.name }} | ||
|
|
||
| - name: Update submodules | ||
| run: | | ||
| git submodule update --remote --recursive | ||
|
|
||
| - name: Check if submodules changed | ||
| id: check_changes | ||
| run: | | ||
| if [[ -n "$(git status --porcelain)" ]]; then | ||
| echo "changes=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "changes=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Commit and push changes | ||
| if: steps.check_changes.outputs.changes == 'true' | ||
| run: | | ||
| git add -A | ||
| git commit -m "Auto-update submodules" | ||
| git push origin ${{ steps.default_branch.outputs.name }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can somehow wire up LLM to summarize the changes later...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like an interesting idea. An alternative would be to list the new commits that the submodules got, but a more concise summary may be more useful.