From bb7321434d35c0541adb64442ec0e44b5b9d9083 Mon Sep 17 00:00:00 2001
From: Tim Kaune <tim.kaune@gmx.de>
Date: Mon, 29 Jan 2024 16:44:11 +0100
Subject: [PATCH] Add filter to git sync workflow

---
 .github/workflows/git-sync.yml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml
index 3df0669..a7d5ab1 100644
--- a/.github/workflows/git-sync.yml
+++ b/.github/workflows/git-sync.yml
@@ -1,9 +1,17 @@
-on: push
+name: sync-git-mirror
+run-name: Push ${{ github.ref_type }} ${{ github.ref_name }} to git mirror
+on:
+  push:
+    branches:
+      - master
+    tags:
+      - v*
 jobs:
   git-sync:
     runs-on: ubuntu-latest
     steps:
       - name: git-sync-master
+        if: ${{ github.ref_type == 'branch' }}
         uses: wei/git-sync@v3
         with:
           source_repo: "lepus2589/LoadStaticSharedTargets"
@@ -12,6 +20,7 @@ jobs:
           destination_branch: "master"
           destination_ssh_private_key: ${{ secrets.DESTINATION_SSH_PRIVATE_KEY }}
       - name: git-sync-tags
+        if: ${{ github.ref_type == 'tag' }}
         uses: wei/git-sync@v3
         with:
           source_repo: "lepus2589/LoadStaticSharedTargets"
-- 
GitLab