X-OpenWrt/.github/workflows/Module-Synchronise_Forks.yml

36 lines
1.0 KiB
YAML
Raw Normal View History

2021-09-02 05:22:07 +00:00
############################################################
2021-11-21 14:02:55 +00:00
# Description: GitHub Action to Synchronise Forks #
2021-09-02 05:22:07 +00:00
# Based on: danshui-git/github-forks-sync-action.git #
# Modify: Hyy2001X #
# Thanks to: https://github.com/281677160 #
############################################################
2021-11-21 14:02:55 +00:00
name: Synchronise Forks
2021-09-02 05:22:07 +00:00
on:
repository_dispatch:
workflow_dispatch:
inputs:
sync_mode:
2021-11-21 14:02:55 +00:00
description: '同步上游所有内容'
2021-09-02 05:22:07 +00:00
default: 'false'
env:
SCRIPT_FILE: Scripts/Sync.sh
jobs:
2021-11-21 14:02:55 +00:00
Job:
2021-09-02 05:22:07 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
2021-11-21 14:02:55 +00:00
- name: Run Synchronise Script
2021-09-02 05:22:07 +00:00
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}}
}