Sync OSCAR Submodule #3
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: Sync OSCAR Submodule | |
| on: | |
| repository_dispatch: | |
| types: [oscar-updated] | |
| schedule: | |
| - cron: "0 6 * * 1" # Weekly Monday 6am UTC as fallback | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # push the submodule bump to main | |
| actions: write # dispatch the deploy workflow | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Update OSCAR submodule | |
| run: | | |
| git submodule update --remote oscar | |
| echo "OSCAR now at $(git -C oscar rev-parse --short HEAD)" | |
| - name: Commit, push, and deploy if changed | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if git diff --quiet -- oscar; then | |
| echo "Submodule already up to date; nothing to do." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add oscar | |
| git commit -m "sync: update OSCAR submodule to $(git -C oscar rev-parse --short HEAD)" | |
| git push origin HEAD:main | |
| echo "Pushed submodule bump; triggering deploy." | |
| # A GITHUB_TOKEN push does not trigger deploy.yml (recursion guard), | |
| # so dispatch it explicitly. workflow_dispatch is exempt from that guard. | |
| gh workflow run deploy.yml --ref main |