Sync Fork with Upstream #74
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 Fork with Upstream | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs every day at midnight UTC | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Add upstream remote | |
| run: | | |
| git remote add upstream https://github.com/device-management-toolkit/console.git || true | |
| - name: Fetch upstream | |
| run: git fetch upstream | |
| - name: Merge upstream/main | |
| run: git merge upstream/main --allow-unrelated-histories --no-edit | |
| - name: Push changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: git push origin main |