Prechádzať zdrojové kódy

Add github action to automatically synchronize wiki (#1232)

Will run daily at midnight UTC. This avoids the need for the workflow in
the heaps-doc repository to use a personal access token.
tobil4sk 11 mesiacov pred
rodič
commit
de8ce10bff
1 zmenil súbory, kde vykonal 32 pridanie a 0 odobranie
  1. 32 0
      .github/workflows/sync_wiki.yml

+ 32 - 0
.github/workflows/sync_wiki.yml

@@ -0,0 +1,32 @@
+name: Synchronize Wiki
+
+on:
+  schedule:
+    # daily, midnight UTC
+    - cron: "0 0 * * *"
+  workflow_dispatch:
+
+jobs:
+  synchronize:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          repository: ${{ github.repository }}.wiki
+          fetch-depth: 0
+      - name: Set git credentials
+        run: |
+          git config user.name "github-actions[bot]"
+          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+      - name: Fetch
+        run: |
+          git remote add upstream ${{ github.server_url }}/${{ github.repository_owner }}/heaps-doc
+          git fetch upstream master
+      - name: Merge
+        run: |
+          git merge upstream/master --no-edit
+      - name: Push
+        run: |
+          git push