0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

サブモジュールにしたGithub Wikiを自動で更新する

Posted at

サブモジュールにしたGithub Wikiを自動で更新するGithub Actionsです。
リポジトリにGithub WikiをサブモジュールにするとClaude Code ActionやCodex Actionなどでドキュメントとして参照することができます。
ローカルの開発環境でもAIでWikiの内容を参照・作成・更新などができます。

name: Wiki Update Handler
on:
  gollum:
  workflow_dispatch:

jobs:
  update-wiki-submodule:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v5
        with:
          submodules: true
          fetch-depth: 0

      - name: Configure Git
        run: |
          git config user.name "[bot] ${GITHUB_ACTOR}"
          git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

      - name: Update Wiki Submodule
        id: update
        run: |
          git submodule update --remote --merge wiki

          if git diff --quiet HEAD; then
            echo "Wiki is already up to date"
            echo "updated=false" >> $GITHUB_OUTPUT
          else
            echo "Wiki has been updated"
            echo "updated=true" >> $GITHUB_OUTPUT
            git add wiki
            git commit -m "docs: update wiki submodule to latest version"
          fi

      - name: Push Changes
        if: steps.update.outputs.updated == 'true'
        run: |
          git push

      - name: Notify Success
        if: steps.update.outputs.updated == 'true'
        run: |
          echo "✅ Wiki submodule has been updated successfully"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?