Update Content Submodule #53
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 Content Submodule | |
| on: | |
| repository_dispatch: | |
| types: [content-updated] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-content: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| token: ${{ github.token }} | |
| - name: Configure git | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| - name: Update submodule | |
| run: | | |
| git submodule update --init --remote src/content/writing | |
| git add src/content/writing | |
| git status --porcelain | |
| if git diff --cached --quiet; then | |
| echo "No content changes detected" | |
| exit 0 | |
| else | |
| echo "Content changes detected!" | |
| git commit -m "Auto-update content submodule" | |
| git push | |
| fi |