mirror of https://github.com/0xERR0R/blocky.git
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Sync Fork
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "*/30 * * * *"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
|
|
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)'
|
|
echo
|
|
echo 'Alternatively, you can disable it for your repo from the web UI:'
|
|
echo 'https://docs.github.com/en/actions/using-workflows/disabling-and-enabling-a-workflow'
|
|
) | tee "$GITHUB_STEP_SUMMARY"
|
|
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
|