From abfebbbd1d8b7546b875be4b48abfdad96a368f5 Mon Sep 17 00:00:00 2001 From: Dmitry Shilov Date: Wed, 30 Sep 2026 10:30:22 +0300 Subject: [PATCH] ci: add daily upstream sync workflow --- .gitea/workflows/sync-upstream.yml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitea/workflows/sync-upstream.yml diff --git a/.gitea/workflows/sync-upstream.yml b/.gitea/workflows/sync-upstream.yml new file mode 100644 index 0000000..fb12c96 --- /dev/null +++ b/.gitea/workflows/sync-upstream.yml @@ -0,0 +1,47 @@ +name: Sync from upstream + +on: + schedule: + - cron: '23 3 * * *' + workflow_dispatch: {} + +permissions: + contents: write + +concurrency: + group: registry-sync + cancel-in-progress: true + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + + - name: Configure git identity + run: | + git config user.name "arka-ops" + git config user.email "ops@arka-ai.ru" + + - name: Merge upstream main + run: | + set -euo pipefail + git remote add upstream https://github.com/librefang/librefang-registry.git || true + git fetch --depth=1 upstream main + # Fast-forward when possible; otherwise record a merge commit so the + # arka-specific files under .gitea/ (which upstream does not ship) + # stay on top of upstream content. + git checkout main + if ! git merge --no-edit -m "chore: merge upstream registry main" upstream/main; then + echo "registry sync merge conflict — resolve manually" >&2 + git merge --abort + exit 1 + fi + + - name: Push to origin + run: | + set -euo pipefail + git push origin main \ No newline at end of file