Sync from Upstream #467
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 | |
| permissions: | |
| contents: write # Needed to push changes to the branch | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'as_upstream' # Checkout the branch we want to update | |
| # Use a PAT to ensure write access and trigger other workflows if needed | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Configure Git User | |
| run: | | |
| git config --global user.name "GitHub Actions Sync" | |
| git config --global user.email "actions@github.com" | |
| - name: Sync with upstream | |
| run: | | |
| git remote add upstream https://github.com/digitalpalidictionary/dpd-db.git | |
| git fetch upstream main | |
| git reset --hard upstream/main | |
| git push --force origin as_upstream |