separating sync wiki workflow from release workflow
This commit is contained in:
@@ -504,39 +504,6 @@ jobs:
|
||||
sync-wiki:
|
||||
needs: create-release
|
||||
if: always() && needs.create-release.result == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout main repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch || github.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout wiki repo
|
||||
run: |
|
||||
git clone "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.wiki.git" wiki
|
||||
|
||||
- name: Sync WIKI.md to Wiki/Home.md
|
||||
run: |
|
||||
set -e
|
||||
SRC_FILE="WIKI.md"
|
||||
DEST_FILE="wiki/Home.md"
|
||||
|
||||
if [ ! -f "$SRC_FILE" ]; then
|
||||
echo "No $SRC_FILE in main repo; skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! cmp -s "$SRC_FILE" "$DEST_FILE"; then
|
||||
echo "Changes found, updating wiki..."
|
||||
cp "$SRC_FILE" "$DEST_FILE"
|
||||
cd wiki
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add Home.md
|
||||
git commit -m "Sync WIKI.md from main repo [skip ci]" || echo "No changes to commit"
|
||||
git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.wiki.git"
|
||||
else
|
||||
echo "No changes in $SRC_FILE; wiki is up to date."
|
||||
fi
|
||||
uses: ./.github/workflows/sync-wiki.yml
|
||||
permissions:
|
||||
contents: write
|
||||
Reference in New Issue
Block a user