Files
quik/.gitea/workflows/sync.yml
T
2026-09-18 14:34:43 +02:00

42 lines
1.5 KiB
YAML

name: Sync Upstream Quik
on:
schedule:
- cron: '0 2 * * 1' # Runs every Monday at 02:00
workflow_dispatch:
jobs:
sync:
name: Sync with Upstream
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "Gitea Automation"
git config user.email "actions@gitea.local"
- name: Fetch and Merge Upstream
run: |
git remote add upstream https://gitea.labus.uk/upstream-mirrors/quik.git
git fetch upstream
# Try to merge upstream master into our master branch.
# If it fails, the step exits with a non-zero code.
git merge upstream/master --no-edit
git push origin master
- name: Notify on Failure
if: failure()
run: |
echo "::error::Merge conflict detected or upstream sync failed! Please resolve manually."
# Automatically create an issue via Gitea API to notify the owner
curl -X POST "${{ github.api_url }}/repos/${{ github.repository }}/issues" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"title": "⚠️ Upstream Sync Failed - Merge Conflict", "body": "The scheduled upstream sync with `quik` encountered a merge conflict or error. Please resolve it manually by pulling from upstream and fixing the conflicts."}'