Merge pull request #8 from AmpereComputing/automated/update-submodules #46
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
| name: Update Submodules | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 6 * * 1' # run every Monday at 6AM UTC | |
| push: | |
| jobs: | |
| update-submodules: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository (with submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Update submodules | |
| run: | | |
| git submodule update --remote --merge --recursive | |
| - name: Check for submodule changes | |
| run: | | |
| if ! git diff --quiet; then | |
| echo "Submodule changes detected." | |
| echo "changes=true" >> $GITHUB_ENV | |
| else | |
| echo "No submodule changes detected." | |
| fi | |
| - name: Configure git user (for create-pull-request commits) | |
| if: env.changes == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Stage submodule changes | |
| if: env.changes == 'true' | |
| run: | | |
| git add projects/* | |
| - name: Create or update PR with submodule bumps (requests reviewer) | |
| if: env.changes == 'true' | |
| uses: peter-evans/create-pull-request@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: 'chore(submodules): update to latest main (automated)' | |
| title: 'chore(submodules): update to latest main (automated)' | |
| body: | | |
| This PR updates the repository's submodule references to the latest tips of their configured branches (e.g., main). | |
| Automated update created by GitHub Actions. | |
| branch: automated/update-submodules | |
| labels: automated | |
| delete-branch: true | |
| reviewers: 'zmeyers-ampere' |