Sync from Upstream #194
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 from Upstream | |
| on: | |
| workflow_dispatch: # Allow manual trigger | |
| schedule: | |
| - cron: '0 0 * * *' # Run daily at midnight UTC | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| # Grant permissions to write to contents | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Configure Git User | |
| run: | | |
| git config --global user.name "GitHub Actions Sync" | |
| git config --global user.email "actions@github.com" | |
| - name: Add Upstream Remote | |
| run: git remote add upstream https://github.com/digitalpalidictionary/dpd-db.git | |
| - name: Fetch Upstream and Origin as_upstream | |
| run: | | |
| git fetch --depth=1 upstream main | |
| git fetch --depth=1 origin as_upstream | |
| - name: Push Upstream Main to Origin Main | |
| run: | | |
| git push --force \ | |
| https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \ | |
| upstream/main:refs/heads/as_upstream |