Skip to content

Sync OSA Submodule

Sync OSA Submodule #23

name: Sync OSA Submodule
on:
repository_dispatch:
types: [osa-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 OSA submodule
run: |
git submodule update --remote osa
echo "OSA now at $(git -C osa rev-parse --short HEAD)"
- name: Commit, push, and deploy if changed
env:
GH_TOKEN: ${{ github.token }}
run: |
if git diff --quiet -- osa; 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 osa
git commit -m "sync: update OSA submodule to $(git -C osa 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