2026-02-12 09:20:55 +03:00
|
|
|
# .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
|
2026-02-12 11:22:51 +03:00
|
|
|
# - uses: https://your-gitea.example.com/org/josh-sync@v1 — pin to your library repo and version
|
2026-02-12 09:20:55 +03:00
|
|
|
|
|
|
|
|
name: "Josh Sync ← Subrepo"
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
schedule:
|
2026-02-14 21:28:40 +03:00
|
|
|
- cron: "0 1,7,13,19 * * *" # Every 6h, offset from forward
|
2026-02-12 09:20:55 +03:00
|
|
|
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
|
|
|
|
|
|
2026-02-14 21:28:40 +03:00
|
|
|
- uses: https://your-gitea.example.com/org/josh-sync@v1.2
|
2026-02-12 09:20:55 +03:00
|
|
|
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 }}
|