ガイド:自動更新
概要
oh-my-agent GitHub Action(first-fluke/oma-update-action@v1)は、CIでoma updateを実行してプロジェクトのエージェントスキルを自動更新します。PRを作成してレビューするモードと、ブランチに直接コミットするモードをサポート。
クイックセットアップ
.github/workflows/update-oh-my-agent.ymlとして追加:
name: Update oh-my-agent
on:
schedule:
- cron: '0 9 * * 1' # 毎週月曜9時UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: first-fluke/oma-update-action@v1
全Action入力
| 入力 | 型 | デフォルト | 説明 |
|---|---|---|---|
mode | string | "pr" | "pr"でPR作成、"commit"で直接コミット |
base-branch | string | "main" | PRのベースブランチまたはコミット先 |
force | string | "false" | "true"でカスタム設定を上書き |
pr-title | string | "chore(deps): update oh-my-agent skills" | PRタイトル |
pr-labels | string | "dependencies,automated" | カンマ区切りラベル |
commit-message | string | "chore(deps): update oh-my-agent skills" | コミットメッセージ |
token | string | ${{ github.token }} | GitHubトークン |
全Action出力
| 出力 | 説明 |
|---|---|
updated | 変更検出時"true" |
version | 更新後のバージョン |
pr-number | PR番号(prモード) |
pr-url | PR URL(prモード) |
詳細例
例1:デフォルトPRモード
- uses: first-fluke/oma-update-action@v1
id: update
- name: Summary
if: steps.update.outputs.updated == 'true'
run: echo "Updated to v${{ steps.update.outputs.version }}"
例2:直接コミット + PAT
- uses: actions/checkout@v4
with:
token: ${{ secrets.OH_MY_AGENT_PAT }}
- uses: first-fluke/oma-update-action@v1
with:
mode: commit
token: ${{ secrets.OH_MY_AGENT_PAT }}
base-branch: develop
例3:Slack通知付き
- uses: first-fluke/oma-update-action@v1
id: update
- name: Notify Slack
if: steps.update.outputs.updated == 'true'
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
{"text": "oh-my-agent updated to v${{ steps.update.outputs.version }}"}
例4:強制更新
- uses: first-fluke/oma-update-action@v1
with:
force: 'true'
pr-title: "chore(deps): force-update oh-my-agent skills (reset configs)"
注意: forceモードはoma-config.yaml、mcp.json、stack/を上書きします。
内部動作
- Bunセットアップ —
oven-sh/setup-bun@v2 - oh-my-agentインストール —
bun install -g oh-my-agent - oma update実行 —
--ciフラグ(非インタラクティブ)、オプションで--force - 変更チェック —
.agents/と.claude/のgit status確認 - モードに応じて処理 — PRモード:
peter-evans/create-pull-request@v8使用。コミットモード:直接コミット・プッシュ。
oma update --ciの内部処理:
- レジストリから
prompt-manifest.json取得 - ローカルバージョンと比較
- 最新tarballダウンロード・展開
- ユーザーカスタム設定を保持(
--force除く) - ベンダー適応とシンボリックリンクを更新