File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync Docs to Wiki
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - ' docs/**'
9+
10+ jobs :
11+ sync-wiki :
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : write
15+ steps :
16+ - name : Checkout main repository
17+ uses : actions/checkout@v4
18+
19+ - name : Sync Markdown files to Wiki
20+ run : |
21+ git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki_temp
22+ cp docs/*.md wiki_temp/
23+ cd wiki_temp
24+
25+ # Byt namn på index.md till Home.md för att skapa startsidan
26+ if [ -f "index.md" ]; then
27+ mv index.md Home.md
28+ fi
29+
30+ # *** HÄR ÄR DEN SISTA FIXEN ***
31+ # Hitta alla .md-filer och ta bort ".md" från slutet av alla länkar inuti dem.
32+ # Detta gör att länkarna fungerar korrekt i GitHubs Wiki-system.
33+ find . -type f -name "*.md" -exec sed -i 's/\.md)/)/g' {} +
34+
35+ git config user.name "github-actions[bot]"
36+ git config user.email "github-actions[bot]@users.noreply.github.com"
37+ git add .
38+
39+ if git diff --staged --quiet; then
40+ echo "Wiki is already up-to-date."
41+ exit 0
42+ fi
43+
44+ git commit -m "Sync documentation and fix internal links"
45+ git push
You can’t perform that action at this time.
0 commit comments