47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
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 |