Skip to content
Closed

fix #3640

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/publish_docs_to_wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ on:
paths:
- docs/** # This includes all sub folders
branches:
- master # This can be changed to any branch of your preference
- master # Publish wiki on merge to master
workflow_dispatch:
inputs:
dry_run:
description: "Run sync and commit checks without pushing to wiki"
required: true
default: true
type: boolean

env:
WIKI_TOKEN: ${{ secrets.WIKI_ACTION_TOKEN }} # Personal Access Token with repo scope
USER_NAME: "GitHub Actions" # Enter the username of your (bot) account
USER_EMAIL: "[email protected]" # Enter the e-mail of your (bot) account
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name
REPOSITORY: ${{ github.repository }} # owner/repository

jobs:
publish_docs_to_wiki:
Expand All @@ -28,18 +34,33 @@ jobs:
# 3. Pull old Wiki content
- name: Pull content from wiki
run: |
[[ -n "$WIKI_TOKEN" ]] || { echo "WIKI_ACTION_TOKEN is empty or not set"; exit 1; }
mkdir tmp_wiki
cd tmp_wiki
git init
git pull https://[email protected]/$OWNER/$REPOSITORY_NAME.wiki.git
git pull https://x-access-token:[email protected]/$REPOSITORY.wiki.git
# 4. Synchronize differences between `docs` & `tmp_wiki`
# 5. Push new Wiki content
- name: Push content to wiki
if: ${{ github.event_name != 'workflow_dispatch' || inputs.dry_run == false }}
run: |
rsync -av --delete docs/ tmp_wiki/ --exclude .git
cd tmp_wiki
git config user.name "$USER_NAME"
git config user.email "$USER_EMAIL"
git add .
git commit -m "Update Wiki content" || echo "No changes to commit"
git push -f --set-upstream https://[email protected]/$OWNER/$REPOSITORY_NAME.wiki.git master
git push -f --set-upstream https://x-access-token:[email protected]/$REPOSITORY.wiki.git master

- name: Dry-run summary
if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }}
run: |
rsync -av --delete docs/ tmp_wiki/ --exclude .git
cd tmp_wiki
git add .
if git diff --cached --quiet; then
echo "Dry-run: no wiki changes detected."
else
echo "Dry-run: wiki changes detected and staged (no push performed)."
git status --short
fi
2 changes: 1 addition & 1 deletion docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Die komplette Anleitung und Nutzerdokumentation für openWB software2 findet Ihr

Auch Ihr als Community könnt an den Artikeln im Wiki für Endanwender mitwirken. Sendet dazu einen Artikel-Vorschlag oder einen Textvorschlag (gerne auch mit Bildern) zur Aktualisierung bzw. Korrektur an unseren Support unter [[email protected]](mailto:[email protected]).

Hier im GitHub-Wiki findet Ihr ausschließlich technische Informationen für Entwickler, wie Ihr mit euren eigenen Pull Requests zur Weiterentwicklung des openWB-Codes beitragen könnt.
Hier im GitHub-Wiki findet Ihr ausschließlich technische Informationen für Entwickler, wie Ihr mit euren eigenen Pull Requests zur Weiterentwicklung des openWB-Codes beitragen könnt.