Skip to content

[docs] Add troubleshooting guide (#71) #173

[docs] Add troubleshooting guide (#71)

[docs] Add troubleshooting guide (#71) #173

Workflow file for this run

name: Update Wiki
on:
workflow_call:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
pull_request_target:
types: [closed]
permissions:
contents: write
pull-requests: read
concurrency:
group: update-wiki-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
preview:
name: Update Wiki Preview
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
env:
WIKI_PREVIEW_BRANCH: pr-${{ github.event.pull_request.number }}
steps:
- name: Checkout PR branch
uses: actions/checkout@v6
with:
token: ${{ github.token }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: recursive
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Cache Composer dependencies
uses: actions/cache@v5
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Mark workspace as safe for git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE/.github/wiki"
- name: Install dependencies
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ github.token }}"} }'
COMPOSER_CACHE_DIR: /tmp/composer-cache
COMPOSER_ROOT_VERSION: dev-${{ github.event.pull_request.head.ref }}
run: composer install --prefer-dist --no-progress --no-interaction --no-scripts
- name: Prepare wiki preview branch
working-directory: .github/wiki
run: |
git fetch origin
if git ls-remote --exit-code --heads origin "${WIKI_PREVIEW_BRANCH}" >/dev/null 2>&1; then
git switch -C "${WIKI_PREVIEW_BRANCH}" --track "origin/${WIKI_PREVIEW_BRANCH}"
git reset --hard "origin/${WIKI_PREVIEW_BRANCH}"
else
git switch --orphan "${WIKI_PREVIEW_BRANCH}"
git rm -rf . >/dev/null 2>&1 || true
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
fi
git clean -fd
- name: Create Docs Markdown
env:
COMPOSER_ROOT_VERSION: dev-${{ github.event.pull_request.head.ref }}
run: composer dev-tools wiki -- --target=.github/wiki
- name: Commit & push wiki preview branch
id: wiki_commit
uses: EndBug/add-and-commit@v10
with:
cwd: .github/wiki
add: .
message: "Update wiki docs for PR #${{ github.event.pull_request.number }}"
default_author: github_actions
push: origin HEAD:${{ env.WIKI_PREVIEW_BRANCH }}
- name: Check submodule pointer changes
id: submodule_status
run: |
if git diff --quiet -- .github/wiki; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit parent repo submodule pointer
if: steps.submodule_status.outputs.changed == 'true'
id: parent_commit
uses: EndBug/add-and-commit@v10
with:
add: .github/wiki
message: "Update wiki submodule pointer for PR #${{ github.event.pull_request.number }}"
default_author: github_actions
pull: "--rebase --autostash"
push: true
publish:
name: Publish Wiki Master
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
env:
WIKI_PUBLISH_BRANCH: master
WIKI_PREVIEW_BRANCH: pr-${{ github.event.pull_request.number }}
steps:
- name: Checkout main branch
uses: actions/checkout@v6
with:
token: ${{ github.token }}
ref: main
submodules: recursive
fetch-depth: 0
- name: Mark workspace as safe for git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE/.github/wiki"
- name: Prepare wiki publish branch from preview branch
working-directory: .github/wiki
run: |
git fetch origin "${WIKI_PUBLISH_BRANCH}" "${WIKI_PREVIEW_BRANCH}"
git switch -C "${WIKI_PUBLISH_BRANCH}" --track "origin/${WIKI_PUBLISH_BRANCH}" || git switch "${WIKI_PUBLISH_BRANCH}"
git reset --hard "origin/${WIKI_PREVIEW_BRANCH}"
git clean -fd
- name: Push wiki publish branch
working-directory: .github/wiki
run: git push --force-with-lease origin HEAD:"${WIKI_PUBLISH_BRANCH}"
- name: Delete wiki preview branch
working-directory: .github/wiki
run: git push origin --delete "${WIKI_PREVIEW_BRANCH}"