.forgejo/workflows/sync-wiki.yaml hinzugefügt
This commit is contained in:
parent
5d8dad1ff0
commit
4205f94845
1 changed files with 35 additions and 0 deletions
35
.forgejo/workflows/sync-wiki.yaml
Normal file
35
.forgejo/workflows/sync-wiki.yaml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
name: Sync Wiki Folder to Wiki Repo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'wiki/**'
|
||||
|
||||
jobs:
|
||||
update-wiki:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.server_url == 'https://source-collab.com'
|
||||
steps:
|
||||
- name: Checkout Main Repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: main-repo
|
||||
|
||||
- name: Checkout Wiki Repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository }}.wiki
|
||||
path: wiki-repo
|
||||
token: ${{ secrets.WIKI_SYNC_TOKEN }}
|
||||
|
||||
- name: Sync and Push
|
||||
run: |
|
||||
cp -r main-repo/wiki/* wiki-repo/
|
||||
cd wiki-repo
|
||||
git config user.name "Source-Collab Bot"
|
||||
git config user.email "bot@source-collab.com"
|
||||
git add .
|
||||
git commit -m "Auto-sync Wiki (Commit: ${{ github.sha }})" || echo "No changes to the commit."
|
||||
git push
|
||||
Loading…
Add table
Add a link
Reference in a new issue