Files
josh-sync/examples/reverse.yml
2026-02-12 09:20:55 +03:00

53 lines
1.6 KiB
YAML

# .gitea/workflows/josh-sync-reverse.yml — Consumer workflow template
# Checks external subrepo(s) for new commits and creates PRs on monorepo.
# Always creates PRs, never pushes directly.
#
# Customize:
# - cron schedule
# - org/josh-sync@v1: pin to your library repo and version
name: "Josh Sync ← Subrepo"
on:
schedule:
- cron: "0 1,7,13,19 * * *" # Every 6h, offset from forward
workflow_dispatch:
inputs:
target:
description: "Target to reverse-sync (empty = all)"
required: false
default: ""
branch:
description: "Branch to reverse-sync (empty = all eligible)"
required: false
default: ""
concurrency:
group: josh-sync-rev-${{ github.event.inputs.target || 'all' }}
cancel-in-progress: false
jobs:
sync:
runs-on: docker
container: node:20-bookworm
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install tools
run: |
apt-get update -qq && apt-get install -y -qq jq curl git openssh-client >/dev/null 2>&1
curl -sL "https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64" \
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq
- uses: org/josh-sync@v1
with:
direction: reverse
target: ${{ github.event.inputs.target || '' }}
branch: ${{ github.event.inputs.branch || '' }}
env:
SYNC_BOT_USER: ${{ secrets.SYNC_BOT_USER }}
SYNC_BOT_TOKEN: ${{ secrets.SYNC_BOT_TOKEN }}
SUBREPO_TOKEN: ${{ secrets.SUBREPO_TOKEN || secrets.SYNC_BOT_TOKEN }}
SUBREPO_SSH_KEY: ${{ secrets.SUBREPO_SSH_KEY }}