Update sync-upstream.yml

Update sync-upstream.yml
This commit is contained in:
Chong Wei Hon 2025-09-24 18:32:58 +08:00 committed by GitHub
parent c4d1d33933
commit 2552d6e605
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 33 deletions

View File

@ -2,42 +2,16 @@ name: Sync Fork
on:
schedule:
- cron: '0 */6 * * *' # Runs every day at midnight UTC
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Fork
uses: actions/checkout@v3
- name: Sync upstream changes
uses: dabreadman/fork-sync-with-upstream-action@v1
with:
# Using a personal access token is recommended for pushing changes.
# The GITHUB_TOKEN has restricted permissions.
token: ${{ secrets.GH_PAT }}
fetch-depth: 0 # Fetches all history for all branches and tags
- name: Set up Git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Add Upstream Remote
run: git remote add upstream https://github.com/djteang/OrangeTV.git
- name: Fetch Upstream
run: git fetch upstream
- name: Sync main Branch
run: |
git checkout main
git merge upstream/main
git push origin main
# Repeat for other branches you want to sync
# - name: Sync develop Branch
# run: |
# git checkout develop
# git merge upstream/develop
# git push origin develop
upstream_repository: djteang/OrangeTV
target_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}