fix: use Wiki secret for authenticated wiki sync (v0.2.8)
Some checks failed
Test / rust-tests (push) Waiting to run
Test / frontend-typecheck (push) Waiting to run
Test / frontend-tests (push) Waiting to run
Test / wiki-sync (push) Waiting to run
Auto Tag / auto-tag (push) Successful in 5s
Test / rust-fmt-check (push) Failing after 2m4s
Release / build-macos-arm64 (push) Successful in 9m3s
Test / rust-clippy (push) Has been cancelled
Release / build-linux-arm64 (push) Failing after 21m39s
Release / build-windows-amd64 (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 8b457c4991
commit bbd46c5322
3 changed files with 32 additions and 53 deletions

View File

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