fix: use Wiki secret for authenticated wiki sync (v0.2.8)
Some checks failed
Release / build-macos-arm64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled

- Updated wiki-sync job to use secrets.Wiki for authentication
- Simplified clone/push logic with token-based auth
- Wiki push will now succeed with proper credentials
- Bumped version to 0.2.8

The workflow now uses the 'Wiki' secret created in Gitea Actions
to authenticate wiki repository pushes. This fixes the authentication
issue that was preventing automatic wiki synchronization.
This commit is contained in:
Shaun Arman 2026-04-03 16:47:32 -05:00
parent 94b486b801
commit 1d40dfb15b
3 changed files with 32 additions and 53 deletions

View File

@ -90,7 +90,7 @@ jobs:
image: alpine:latest image: alpine:latest
steps: steps:
- name: Install dependencies - name: Install dependencies
run: apk add --no-cache git openssh-client run: apk add --no-cache git
- name: Checkout main repository - name: Checkout main repository
run: | run: |
@ -103,73 +103,52 @@ jobs:
run: | run: |
git config --global user.email "actions@gitea.local" git config --global user.email "actions@gitea.local"
git config --global user.name "Gitea Actions" git config --global user.name "Gitea Actions"
# Disable credential helper to avoid prompts
git config --global credential.helper ''
- name: Clone wiki repository - name: Clone and sync wiki
env:
WIKI_TOKEN: ${{ secrets.Wiki }}
run: | run: |
# Clone wiki repository with authentication
cd /tmp cd /tmp
# Use token authentication if available, fallback to unauthenticated if [ -n "$WIKI_TOKEN" ]; then
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then WIKI_URL="http://${WIKI_TOKEN}@172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
WIKI_URL="http://${{ secrets.GITHUB_TOKEN }}@172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
else else
WIKI_URL="http://172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git" WIKI_URL="http://172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
fi fi
git clone "$WIKI_URL" wiki || true
- name: Initialize wiki if clone failed if ! git clone "$WIKI_URL" wiki 2>/dev/null; then
run: | echo "Wiki doesn't exist yet, creating initial structure..."
if [ ! -d /tmp/wiki ]; then mkdir -p wiki
echo "Wiki repository doesn't exist yet or clone failed, initializing..." cd wiki
mkdir -p /tmp/wiki
cd /tmp/wiki
git init git init
git checkout -b master git checkout -b master
echo "# Wiki" > Home.md echo "# Wiki" > Home.md
git add Home.md git add Home.md
git commit -m "Initial wiki commit" git commit -m "Initial wiki commit"
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then
WIKI_URL="http://${{ secrets.GITHUB_TOKEN }}@172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
else
WIKI_URL="http://172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
fi
git remote add origin "$WIKI_URL" git remote add origin "$WIKI_URL"
fi fi
- name: Sync wiki files # Copy wiki files
run: |
# Copy all markdown files from docs/wiki/ to wiki repo root
if [ -d "docs/wiki" ] && [ "$(ls -A docs/wiki/*.md 2>/dev/null)" ]; then
cp -v docs/wiki/*.md /tmp/wiki/
echo "Copied $(ls docs/wiki/*.md | wc -l) wiki files"
else
echo "No wiki markdown files found in docs/wiki/"
fi
- name: Commit and push wiki changes
run: |
cd /tmp/wiki cd /tmp/wiki
git add -A if [ -d "$GITHUB_WORKSPACE/docs/wiki" ]; then
cp -v "$GITHUB_WORKSPACE"/docs/wiki/*.md . 2>/dev/null || echo "No wiki files to copy"
# Check if there are any changes
if git diff --staged --quiet; then
echo "No wiki changes to commit"
exit 0
fi fi
# Commit changes # Commit if there are changes
git add -A
if ! git diff --staged --quiet; then
git commit -m "docs: sync from docs/wiki/ at commit ${GITHUB_SHA:0:8}" git commit -m "docs: sync from docs/wiki/ at commit ${GITHUB_SHA:0:8}"
# Prepare push URL with token if available # Push using token authentication
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then echo "Pushing to wiki..."
WIKI_URL="http://${{ secrets.GITHUB_TOKEN }}@172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git" if git push origin master; then
else
WIKI_URL="http://172.0.0.29:3000/sarman/tftsr-devops_investigation.wiki.git"
fi
# Push to wiki
if git push "$WIKI_URL" master; then
echo "✓ Wiki successfully synced" echo "✓ Wiki successfully synced"
else else
echo "⚠ Wiki push failed - you may need to configure authentication" echo "⚠ Wiki push failed - check token permissions"
echo " To enable automatic wiki sync, add a Gitea token with repository write access"
exit 1 exit 1
fi fi
else
echo "No wiki changes to commit"
fi

View File

@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for TFTSR — least-privilege","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","dialog:allow-open","dialog:allow-save","fs:allow-read-text-file","fs:allow-write-text-file","fs:allow-read","fs:allow-write","fs:allow-mkdir","fs:allow-app-read-recursive","fs:allow-app-write-recursive","fs:allow-temp-read-recursive","fs:allow-temp-write-recursive","fs:scope-app-recursive","fs:scope-temp-recursive","shell:allow-execute","http:default"]}} {"default":{"identifier":"default","description":"Default capabilities for TFTSR — least-privilege","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","dialog:allow-open","dialog:allow-save","fs:allow-read-text-file","fs:allow-write-text-file","fs:allow-read","fs:allow-write","fs:allow-mkdir","fs:allow-app-read-recursive","fs:allow-app-write-recursive","fs:allow-temp-read-recursive","fs:allow-temp-write-recursive","fs:scope-app-recursive","fs:scope-temp-recursive","shell:allow-execute","shell:allow-open","http:default"]}}

View File

@ -1,6 +1,6 @@
{ {
"productName": "TFTSR", "productName": "TFTSR",
"version": "0.2.7", "version": "0.2.8",
"identifier": "com.tftsr.devops", "identifier": "com.tftsr.devops",
"build": { "build": {
"frontendDist": "../dist", "frontendDist": "../dist",