36 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			YAML
		
	
	
	
############################################################
 | 
						|
#   Description: GitHub Action to synchronise forks        #
 | 
						|
#   Based on: danshui-git/github-forks-sync-action.git     #
 | 
						|
#   Modify: Hyy2001X                                       #
 | 
						|
#   Thanks to: https://github.com/281677160                #
 | 
						|
############################################################
 | 
						|
 | 
						|
name: Synchronise Fork
 | 
						|
 | 
						|
on:
 | 
						|
  repository_dispatch:
 | 
						|
  workflow_dispatch:
 | 
						|
    inputs:
 | 
						|
      sync_mode:
 | 
						|
        description: '同步上游所有内容'
 | 
						|
        default: 'false'
 | 
						|
 | 
						|
env:
 | 
						|
  SCRIPT_FILE: Scripts/Sync.sh
 | 
						|
 | 
						|
jobs:
 | 
						|
  build:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    
 | 
						|
    steps:
 | 
						|
    - name: Checkout
 | 
						|
      uses: actions/checkout@main
 | 
						|
 | 
						|
    - name: Run synchronise script
 | 
						|
      run: |
 | 
						|
        [ "${{github.event.inputs.sync_mode}}" == true ] && {
 | 
						|
            bash $GITHUB_WORKSPACE/Scripts/Sync.sh ${{secrets.GITHUB_TOKEN}} ${{github.repository}} --sync-all
 | 
						|
        } || {
 | 
						|
            bash $GITHUB_WORKSPACE/Scripts/Sync.sh ${{secrets.GITHUB_TOKEN}} ${{github.repository}}
 | 
						|
        }        
 |