Sync #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 | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: sync | |
| cancel-in-progress: true | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Update submodule | |
| run: git submodule update --remote --rebase | |
| - name: Check update | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "update=true" >> $GITHUB_ENV | |
| else | |
| echo "update=false" >> $GITHUB_ENV | |
| fi | |
| - name: Commit update | |
| if: env.update == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: sync with ejs" | |
| git push origin main |