forked from 0xERR0R/blocky
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 902 Bytes
/
fork-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Sync Fork
on:
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
jobs:
sync:
name: Sync with Upstream
runs-on: ubuntu-latest
if: github.repository_owner != '0xERR0R'
steps:
- name: Enabled Check
id: check
shell: bash
run: |
if [[ "${{ secrets.FORK_SYNC_TOKEN }}" != "" ]]; then
echo "enabled=1" >> $GITHUB_OUTPUT
echo "Workflow is enabled"
else
echo "enabled=0" >> $GITHUB_OUTPUT
echo "Workflow is disabled(create FORK_SYNC_TOKEN secret with repo write permission to enable it)"
fi
- name: Sync
if: ${{ steps.check.outputs.enabled == 1 }}
env:
GH_TOKEN: ${{ secrets.FORK_SYNC_TOKEN }}
shell: bash
run: |
gh repo sync ${{ github.repository }} -b main